- API version: 2.0.0
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json
:
{
"require": {
"pananames/api": "^2.0"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once(__DIR__ . '/vendor/autoload.php');
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use Pananames\Api\DomainsApi;
$domainsApi = new DomainsApi('SIGNATURE', 'URL');
$response = $domainsApi->check('domain-example.com');
if ($response->hasErrors()) {
$errors = $response->getErrors();
//Log etc.
return;
}
$data = $response->getData();
$httpCode = $response->getHttpCode();
$isSuccessful = $response->isSuccessful();
$isAvailable = $data->getAvailable();
$isPremium = $data->getPremium();
?>