1. Go to this page and download the library: Download mannydmorales/101domain-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mannydmorales / 101domain-api example snippets
use mannydmorales\the101domain\api\Client;
$client = new Client('your-bearer-token');
// Check account balance
$balance = $client->account()->balance();
echo "Credit: {$balance->creditBalance} {$balance->currency}";
// List your domains
$page = $client->domains()->list(page: 1, perPage: 25);
foreach ($page->items as $domain) {
echo "{$domain->domainName} — {$domain->status}\n";
}
// Check domain availability
$result = $client->domains()->search('my-new-domain.com');
if ($result->available) {
echo "Available! Register for {$result->firstPrice()->register} {$result->firstPrice()->currency}";
}
use mannydmorales\the101domain\api\Exceptions\ApiException;
use mannydmorales\the101domain\api\Exceptions\AuthenticationException;
use mannydmorales\the101domain\api\Exceptions\ForbiddenException;
use mannydmorales\the101domain\api\Exceptions\NotFoundException;
use mannydmorales\the101domain\api\Exceptions\RateLimitException;
use mannydmorales\the101domain\api\Exceptions\ValidationException;
try {
$domain = $client->domains()->get('example.com');
} catch (AuthenticationException $e) {
// 401 — token is invalid or expired
} catch (ForbiddenException $e) {
// 403 — token lacks the