PHP code example of upmind / domainnameapi-sdk

1. Go to this page and download the library: Download upmind/domainnameapi-sdk 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/ */

    

upmind / domainnameapi-sdk example snippets







use Upmind\DomainNameApiSdk\ClientFactory;

*/
$client = (new ClientFactory())->create($username, $password, ClientFactory::ENV_TEST, $psr3Logger);

$request = (new GetDetailsRequest())->setDomainName($domain);
$response = $client->GetDetails(new GetDetails($request));
$result = $response->getGetDetailsResult();

$domainInfo = $result->getDomainInfo();
if (!$domainInfo) {
    throw new RuntimeException(sprintf('API Error (%s): %s', $result->getErrorCode(), $result->getOperationMessage()));
}

/** @var \Upmind\DomainNameApiSdk\SDK\StructType\DomainInfo $domainInfo */
$status = $domainInfo->getStatus();
$nameservers = $domainInfo->getNameServerList();
$expiryDate = $domainInfo->getExpirationDate();
// ...