mijnpartnergroep-nl/sidn-suggestion-api-php
Composer 安装命令:
composer require mijnpartnergroep-nl/sidn-suggestion-api-php
包简介
SIDN Suggestion API client library for PHP. SIDN is the registrar for .nl fqdn's.
关键字:
README 文档
README
PHP client for SIDN suggestion API
Requirements and Authorization
To use the API you must request access by sending a request to support@sidn.nl or contacting your SIDN representative. When approved you will be provided with access to the API. The API uses the Client Authorization flow for server-side authorization. To start the authorization flow, you need to request a clientId and clientSecret. You can request these from SIDN Support.
Installation
The easiest way to install this client is to require it using Composer.
Install using composer require MijnPartnerGroep-nl/sidn-suggestion-api-php:^0.1
Or add to your composer.json:
{
"require": {
"MijnPartnerGroep-nl/sidn-suggestion-api-php": "^0.1"
}
}
Example usage
Example usage as found in the examples folder.
<?php include("vendor\autoload.php"); use \Sidn\Suggestion\Api\Exceptions\ApiException; use \Sidn\Suggestion\Api\SidnSuggestionApiClient; try { // Create new instance of SidnSuggestionApiClient $sidnApi = new SidnSuggestionApiClient(); // Authenticate using Client Id and Client Secret provided by SIDN $auth = $sidnApi->authenticate->authenticate($client_id, $client_secret); $sidnApi->setAccessToken($auth->access_token); // Search for domain suggestions $suggestions = $sidnApi->suggestion->search("bike.nl", 1000); print_r($suggestions->suggestions); // Optionally, query the used configuration from the results print_r($suggestions->config); // Optionally, query the used domain (cleaned) from the results print_r($suggestions->original); } catch (ApiException $ae) { echo "Error occured at: ".$ae->getTimestamp() . ";<br />Message: ".$ae->getMessage(); throw $ae; }
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2021-10-25