### Composer Integration and Initialization Source: https://github.com/domainreseller/php-dna/blob/main/README.md After installing with Composer, include the autoloader and then instantiate the API client. This is the recommended integration method. ```php require_once __DIR__.'/vendor/autoload.php'; $dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('username','password'); ``` -------------------------------- ### Install PHP Library using Composer Source: https://github.com/domainreseller/php-dna/blob/main/README.md Install the library via Composer for easy dependency management. Ensure you have Composer installed and configured. ```bash composer require domainreseller/php-dna ``` -------------------------------- ### Manual Installation of PHP Library Source: https://github.com/domainreseller/php-dna/blob/main/README.md Include the library file manually after downloading it. This method requires direct file inclusion. ```php require_once __DIR__.'/DomainNameApi/DomainNameAPI_PHPLibrary.php'; $dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('username','password'); ``` -------------------------------- ### Get Reseller Details Source: https://github.com/domainreseller/php-dna/blob/main/README.md Retrieves detailed information about the reseller account. ```APIDOC ## Get Reseller Details ### Description Retrieves detailed information about the reseller account, including ID, status, name, and balance information. ### Method ```php GetResellerDetails() ``` ### Parameters This method does not accept any parameters. ### Response #### Success Response (200) - **result** (string) - Indicates the status of the operation, e.g., 'OK'. - **id** (integer) - The unique identifier for the reseller. - **active** (integer) - Indicates if the reseller account is active (1) or inactive (0). - **name** (string) - The name of the reseller. - **balance** (float) - The current balance of the reseller account. - **currency** (string) - The primary currency of the reseller account. - **symbol** (string) - The currency symbol. - **balances** (array) - An array of balances for different currencies. ``` -------------------------------- ### Get Domain Details Source: https://github.com/domainreseller/php-dna/blob/main/README.md Retrieves detailed information about a specific domain. Ensure the domain name is correctly specified. ```php $dna->GetDetails('example.com'); ``` -------------------------------- ### Get Reseller Details PHP Source: https://github.com/domainreseller/php-dna/blob/main/README.md Retrieve details about the reseller account. This function returns basic account information. ```php $dna->GetResellerDetails(); ``` -------------------------------- ### Get TLD List Source: https://github.com/domainreseller/php-dna/blob/main/README.md Retrieves a list of available Top-Level Domains (TLDs) with their pricing and currency information. This is useful for displaying available domain extensions to users. ```php $dna->GetTldList(100); ``` ```php Array ( [data] => Array ( [0] => Array ( [id] => 1 [status] => Active [maxchar] => 63 [maxperiod] => 10 [minchar] => 1 [minperiod] => 1 [tld] => com [pricing] => Array ( [registration] => Array ( [1] => 10.8100 ) [renew] => Array ( [1] => 11.0100 ) [transfer] => Array ( [1] => 10.6100 ) [restore] => Array ( [1] => 99.9000 ) ) [currencies] => Array ( [registration] => USD [renew] => USD [transfer] => USD [restore] => USD ) ) ) [result] => OK ) ``` -------------------------------- ### Get Domain List Source: https://github.com/domainreseller/php-dna/blob/main/README.md Retrieves a paginated list of domains associated with the account, sorted by ID in ascending order. Use this to fetch all domains for management or review. ```php $dna->GetList(['OrderColumn'=>'Id', 'OrderDirection'=>'ASC', 'PageNumber'=>0,'PageSize'=>1000]); ``` ```php Array ( [data] => Array ( [Domains] => Array ( [0] => Array ( [ID] => 564346 [Status] => Active [DomainName] => example.com [AuthCode] => DHQ!K52 [LockStatus] => false [PrivacyProtectionStatus] => false [IsChildNameServer] => false [Contacts] => Array ( [Billing] => Array ( [ID] => 11854114 ) [Technical] => Array ( [ID] => 11854114 ) [Administrative] => Array ( [ID] => 11854114 ) [Registrant] => Array ( [ID] => 11854114 ) ) [Dates] => Array ( [Start] => 2024-03-15T10:00:00 [Expiration] => 2025-03-15T10:00:00 [RemainingDays] => 365 ) [NameServers] => Array ( [0] => ns1.example.com [1] => ns2.example.com ) [Additional] => Array ( ) [ChildNameServers] => Array ( [0] => Array ( [ns] => ns1.example.com [ip] => 1.2.3.4 ) ) ) ) ) [result] => OK [TotalCount] => 1 ) ``` -------------------------------- ### Get Domain Details Source: https://github.com/domainreseller/php-dna/blob/main/README.md Retrieves detailed information about a specific domain, including its status, expiration dates, and contact information. ```APIDOC ## Get Domain Details ### Description Retrieves detailed information about a specific domain. ### Method ```php $dna->GetDetails(string $domainName) ``` ### Parameters #### Path Parameters - **domainName** (string) - Required - The name of the domain to retrieve details for. ### Response #### Success Response (200) - **data** (array) - Contains domain details including ID, Status, DomainName, AuthCode, LockStatus, PrivacyProtectionStatus, IsChildNameServer, Contacts, Dates, NameServers, Additional, and ChildNameServers. - **result** (string) - Indicates the success of the operation ('OK'). ``` -------------------------------- ### Sample Output for Domain Registration Source: https://github.com/domainreseller/php-dna/blob/main/README.md This is a sample response structure for a successful domain registration. It includes details like the domain ID, status, auth code, and contact information. ```php Array ( [result] => OK [data] => Array ( [ID] => 123456 [Status] => clientTransferProhibited [DomainName] => example.com [AuthCode] => Xy9#mK2$pL5@vN8 [LockStatus] => true [PrivacyProtectionStatus] => false [IsChildNameServer] => false [Contacts] => Array ( [Billing] => Array ( [ID] => 987654 ) [Technical] => Array ( [ID] => 987654 ) [Administrative] => Array ( [ID] => 987654 ) [Registrant] => Array ( [ID] => 987654 ) ) [Dates] => Array ( [Start] => 2024-03-15T10:00:00 [Expiration] => 2025-03-15T10:00:00 [RemainingDays] => 365 ) [NameServers] => Array ( [0] => ns1.example.com [1] => ns2.example.com ) [Additional] => Array ( ) [ChildNameServers] => Array ( ) ) ) ``` -------------------------------- ### Initialize DomainNameAPI_PHPLibrary Source: https://github.com/domainreseller/php-dna/blob/main/README.md Instantiate the DomainNameAPI_PHPLibrary class. The mode (SOAP or REST) is automatically selected based on the username format. SOAP uses regular usernames, while REST uses UUID format. ```APIDOC ## Initialize DomainNameAPI_PHPLibrary ### Description Instantiate the DomainNameAPI_PHPLibrary class. The mode (SOAP or REST) is automatically selected based on the username format. SOAP uses regular usernames, while REST uses UUID format. ### Method `new \DomainNameApi\DomainNameAPI_PHPLibrary(string $username, string $password)` ### Parameters #### Path Parameters - **username** (string) - Required - Your reseller username or UUID. - **password** (string) - Required - Your reseller password or API token. ### Request Example ```php // SOAP mode (legacy credentials) $dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('myreseller', 'mypassword'); // REST mode (UUID credentials) $dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('fd2bea54-99ea-16b6-c195-3a1b9079df00', 'your-api-token'); ``` ``` -------------------------------- ### Sample Output for Domain Transfer Source: https://github.com/domainreseller/php-dna/blob/main/README.md A successful domain transfer operation usually returns a simple OK status. ```php Array ( [result] => OK ) ``` -------------------------------- ### Initialize API Client for SOAP or REST Mode Source: https://github.com/domainreseller/php-dna/blob/main/README.md Instantiate the DomainNameAPI_PHPLibrary class. The mode is automatically determined by the username format (regular for SOAP, UUID for REST). ```php // SOAP mode (legacy credentials) $dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('myreseller', 'mypassword'); // REST mode (UUID credentials) $dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('fd2bea54-99ea-16b6-c195-3a1b9079df00', 'your-api-token'); // Both modes use the exact same method calls $details = $dna->GetResellerDetails(); $domains = $dna->GetList(); ``` -------------------------------- ### Run All PHPUnit Tests Source: https://github.com/domainreseller/php-dna/blob/main/README.md Execute all PHPUnit tests using the configuration from .env.test. The --testdox flag provides a readable output. ```bash env $(cat .env.test | xargs) vendor/bin/phpunit --testdox ``` -------------------------------- ### Environment Configuration for Tests Source: https://github.com/domainreseller/php-dna/blob/main/README.md Configure your API credentials and domain information in the .env.test file for running tests. ```env SOAP_USER=your-soap-username SOAP_PASS=your-soap-password REST_USER=your-uuid-rest-username REST_PASS=your-rest-api-token SOAP_DOMAIN=yourdomain.com REST_DOMAIN=yourdomain.com SOAP_DOMAIN_CONTACTS=yourdomain-with-contacts.com REST_DOMAIN_CONTACTS=yourdomain-with-contacts.com ``` -------------------------------- ### Register a Domain with Contact Information Source: https://github.com/domainreseller/php-dna/blob/main/README.md Register a domain name, providing contact details for administrative, billing, technical, and registrant roles. Additional parameters are required for specific TLDs like .tr. ```php $contact = [ "FirstName" => 'John', "LastName" => 'Doe', "Company" => 'Example Corp', "EMail" => 'john.doe@example.com', "AddressLine1" => '123 Lorem Street', "AddressLine2" => 'Suite 456', "AddressLine3" => '', "City" => 'Springfield', "Country" => 'US', "Fax" => '1234567890', "FaxCountryCode" => '1', "Phone" => '9876543210', "PhoneCountryCode" => 1, "Type" => 'Contact', "ZipCode" => '12345', "State" => 'IL' ]; $dna->RegisterWithContactInfo( 'example.com', 1, [ 'Administrative' => $contact, 'Billing' => $contact, 'Technical' => $contact, 'Registrant' => $contact ], ["ns1.example.com", "ns2.example.com"], true, false, // Additional attributes are only required for .tr domains [ 'TRABISDOMAINCATEGORY' => 1, 'TRABISCITIZIENID' => '12345678901', 'TRABISNAMESURNAME' => 'John Doe', 'TRABISCOUNTRYID' => '840', 'TRABISCITYID' => '17' ]); ``` -------------------------------- ### Add Child Nameserver Source: https://github.com/domainreseller/php-dna/blob/main/README.md Adds a child nameserver for a domain, specifying the nameserver hostname and its IP address. ```php $dna->AddChildNameServer('example.com', 'ns1.example.com', '1.2.3.4'); ``` -------------------------------- ### RegisterWithContactInfo Source: https://github.com/domainreseller/php-dna/blob/main/README.md Registers a domain name with specified contact information and name servers. Additional parameters are required for certain TLDs like .tr. ```APIDOC ## RegisterWithContactInfo ### Description Registers a domain name with specified contact information and name servers. Additional parameters are required for certain TLDs like .tr. ### Method `RegisterWithContactInfo(string $domainName, int $years, array $contacts, array $nameServers, bool $lockStatus, bool $privacyProtectionStatus, array $additional = [])` ### Parameters #### Path Parameters - **domainName** (string) - Required - The domain name to register (e.g., 'example.com'). - **years** (int) - Required - The number of years to register the domain for. - **contacts** (array) - Required - An associative array containing contact details for 'Administrative', 'Billing', 'Technical', and 'Registrant' roles. - Each contact should be an array with fields like 'FirstName', 'LastName', 'Company', 'EMail', 'AddressLine1', 'City', 'Country', 'ZipCode', 'State', 'Phone', 'PhoneCountryCode', 'Fax', 'FaxCountryCode', 'Type'. - **nameServers** (array) - Required - An array of name servers for the domain (e.g., `["ns1.example.com", "ns2.example.com"]`). - **lockStatus** (bool) - Required - Whether to enable domain lock. - **privacyProtectionStatus** (bool) - Required - Whether to enable privacy protection. - **additional** (array) - Optional - Additional attributes required for specific TLDs (e.g., .tr domains). - Example for .tr: `['TRABISDOMAINCATEGORY' => 1, 'TRABISCITIZIENID' => '12345678901', 'TRABISNAMESURNAME' => 'John Doe', 'TRABISCOUNTRYID' => '840', 'TRABISCITYID' => '17']` ### Request Example ```php $contact = [ "FirstName" => 'John', "LastName" => 'Doe', "Company" => 'Example Corp', "EMail" => 'john.doe@example.com', "AddressLine1" => '123 Lorem Street', "AddressLine2" => 'Suite 456', "City" => 'Springfield', "Country" => 'US', "Fax" => '1234567890', "FaxCountryCode" => '1', "Phone" => '9876543210', "PhoneCountryCode" => 1, "Type" => 'Contact', "ZipCode" => '12345', "State" => 'IL' ]; $dna->RegisterWithContactInfo( 'example.com', 1, [ 'Administrative' => $contact, 'Billing' => $contact, 'Technical' => $contact, 'Registrant' => $contact ], ["ns1.example.com", "ns2.example.com"], true, false, // Additional attributes are only required for .tr domains [ 'TRABISDOMAINCATEGORY' => 1, 'TRABISCITIZIENID' => '12345678901', 'TRABISNAMESURNAME' => 'John Doe', 'TRABISCOUNTRYID' => '840', 'TRABISCITYID' => '17' ] ); ``` ### Response #### Success Response (200) - **result** (string) - Indicates the status of the operation ('OK' or an error message). - **data** (array) - Contains details of the registered domain if successful. - **ID** (string) - The domain ID. - **Status** (string) - The current status of the domain. - **DomainName** (string) - The registered domain name. - **AuthCode** (string) - The authorization code for the domain. - **LockStatus** (bool) - Indicates if the domain is locked. - **PrivacyProtectionStatus** (bool) - Indicates if privacy protection is enabled. - **IsChildNameServer** (bool) - Indicates if child name servers are used. - **Contacts** (array) - Details of associated contacts. - **Dates** (array) - Registration and expiration dates. - **NameServers** (array) - List of name servers. - **Additional** (array) - Additional attributes. - **ChildNameServers** (array) - List of child name servers. #### Response Example ```json { "result": "OK", "data": { "ID": "123456", "Status": "clientTransferProhibited", "DomainName": "example.com", "AuthCode": "Xy9#mK2$pL5@vN8", "LockStatus": true, "PrivacyProtectionStatus": false, "IsChildNameServer": false, "Contacts": { "Billing": {"ID": "987654"}, "Technical": {"ID": "987654"}, "Administrative": {"ID": "987654"}, "Registrant": {"ID": "987654"} }, "Dates": { "Start": "2024-03-15T10:00:00", "Expiration": "2025-03-15T10:00:00", "RemainingDays": 365 }, "NameServers": ["ns1.example.com", "ns2.example.com"], "Additional": [], "ChildNameServers": [] } } ``` ``` -------------------------------- ### GetList Source: https://github.com/domainreseller/php-dna/blob/main/README.md Retrieves a list of domains associated with the reseller account. Supports sorting and pagination. ```APIDOC ## GetList ### Description Retrieves a list of domains. Supports sorting by specified columns and pagination. ### Method ``` $dna->GetList(array $options) ``` ### Parameters #### Options - **OrderColumn** (string) - Optional - The column to order the results by (e.g., 'Id'). - **OrderDirection** (string) - Optional - The direction of the order ('ASC' or 'DESC'). - **PageNumber** (integer) - Optional - The page number for pagination. - **PageSize** (integer) - Optional - The number of results per page. ### Request Example ```php $dna->GetList(['OrderColumn'=>'Id', 'OrderDirection'=>'ASC', 'PageNumber'=>0,'PageSize'=>1000]); ``` ### Response #### Success Response (200) - **data.Domains** (array) - An array of domain objects. - **result** (string) - Indicates the result status (e.g., 'OK'). - **TotalCount** (integer) - The total number of domains available. Sample Domain Object: - **ID** (integer) - **Status** (string) - **DomainName** (string) - **AuthCode** (string) - **LockStatus** (boolean) - **PrivacyProtectionStatus** (boolean) - **IsChildNameServer** (boolean) - **Contacts** (object) - Contains contact IDs for Billing, Technical, Administrative, and Registrant. - **Dates** (object) - Contains Start, Expiration, and RemainingDays. - **NameServers** (array of strings) - **Additional** (object) - **ChildNameServers** (array of objects with 'ns' and 'ip') ### Response Example ```json { "data": { "Domains": [ { "ID": 564346, "Status": "Active", "DomainName": "example.com", "AuthCode": "DHQ!K52", "LockStatus": false, "PrivacyProtectionStatus": false, "IsChildNameServer": false, "Contacts": { "Billing": {"ID": 11854114}, "Technical": {"ID": 11854114}, "Administrative": {"ID": 11854114}, "Registrant": {"ID": 11854114} }, "Dates": { "Start": "2024-03-15T10:00:00", "Expiration": "2025-03-15T10:00:00", "RemainingDays": 365 }, "NameServers": ["ns1.example.com", "ns2.example.com"], "Additional": {}, "ChildNameServers": [ { "ns": "ns1.example.com", "ip": "1.2.3.4" } ] } ] }, "result": "OK", "TotalCount": 1 } ``` ``` -------------------------------- ### Add Child Nameserver Source: https://github.com/domainreseller/php-dna/blob/main/README.md Adds a child nameserver for a domain. ```APIDOC ## Add Child Nameserver ### Description Adds a child nameserver for a domain. ### Method ```php $dna->AddChildNameServer(string $domainName, string $nameServer, string $ipAddress) ``` ### Parameters #### Path Parameters - **domainName** (string) - Required - The name of the domain. - **nameServer** (string) - Required - The name of the child nameserver to add. - **ipAddress** (string) - Required - The IP address for the child nameserver. ### Response #### Success Response (200) - **data** (array) - Contains the added NameServer and its IPAdresses. - **result** (string) - Indicates the success of the operation ('OK'). ``` -------------------------------- ### GetTldList Source: https://github.com/domainreseller/php-dna/blob/main/README.md Retrieves a list of all available Top-Level Domains (TLDs) supported by the reseller. ```APIDOC ## GetTldList ### Description Retrieves a list of all available Top-Level Domains (TLDs) with their associated pricing and currency information. ### Method ``` $dna->GetTldList(integer $limit) ``` ### Parameters #### Path Parameters - **limit** (integer) - Required - The maximum number of TLDs to retrieve. ### Request Example ```php $dna->GetTldList(100); ``` ### Response #### Success Response (200) - **data** (array) - An array of TLD objects. - **result** (string) - Indicates the result status (e.g., 'OK'). Sample TLD Object: - **id** (integer) - **status** (string) - **maxchar** (integer) - **maxperiod** (integer) - **minchar** (integer) - **minperiod** (integer) - **tld** (string) - The TLD identifier (e.g., 'com'). - **pricing** (object) - Contains pricing details for registration, renew, transfer, and restore. - **currencies** (object) - Contains currency codes for registration, renew, transfer, and restore. ### Response Example ```json { "data": [ { "id": 1, "status": "Active", "maxchar": 63, "maxperiod": 10, "minchar": 1, "minperiod": 1, "tld": "com", "pricing": { "registration": {"1": "10.8100"}, "renew": {"1": "11.0100"}, "transfer": {"1": "10.6100"}, "restore": {"1": "99.9000"} }, "currencies": { "registration": "USD", "renew": "USD", "transfer": "USD", "restore": "USD" } } ], "result": "OK" } ``` ``` -------------------------------- ### Sample Output for Domain Renewal Source: https://github.com/domainreseller/php-dna/blob/main/README.md The output for a domain renewal operation typically includes the updated expiration date. ```php Array ( [result] => OK [data] => Array ( [ExpirationDate] => 2025-03-15T10:00:00 ) ) ``` -------------------------------- ### Enable Domain Lock Source: https://github.com/domainreseller/php-dna/blob/main/README.md Enables the theft protection lock for a domain, preventing unauthorized transfers. ```APIDOC ## Enable Domain Lock ### Description Enables the theft protection lock for a domain. ### Method ```php $dna->EnableTheftProtectionLock(string $domainName) ``` ### Parameters #### Path Parameters - **domainName** (string) - Required - The name of the domain to lock. ### Response #### Success Response (200) - **data** (array) - Contains the updated LockStatus. - **result** (string) - Indicates the success of the operation ('OK'). ``` -------------------------------- ### Transfer a Domain Source: https://github.com/domainreseller/php-dna/blob/main/README.md Transfer a domain name to your reseller account. This requires the domain name and its authorization code. ```php $dna->Transfer('example.com', 'Xy9#mK2$', 3); ``` -------------------------------- ### Run Specific PHPUnit Test Suites Source: https://github.com/domainreseller/php-dna/blob/main/README.md Filter and run specific test suites like SOAP read operations or REST write operations using the --filter flag. ```bash # SOAP read operations only env $(cat .env.test | xargs) vendor/bin/phpunit --testdox --filter SoapRead # REST write operations only env $(cat .env.test | xargs) vendor/bin/phpunit --testdox --filter RestWrite ``` -------------------------------- ### CheckAvailability Source: https://github.com/domainreseller/php-dna/blob/main/README.md Checks the availability of one or more domains for a specified TLD and action. ```APIDOC ## CheckAvailability ### Description Checks the availability of specified domains for given TLDs, action, and registration period. ### Method ``` $dna->CheckAvailability(array $domains, array $tlds, integer $period, string $command) ``` ### Parameters #### Path Parameters - **domains** (array of strings) - Required - A list of domain names to check. - **tlds** (array of strings) - Required - A list of TLDs to check against. - **period** (integer) - Required - The registration period in years. - **command** (string) - Required - The action to check for (e.g., 'create'). ### Request Example ```php $dna->CheckAvailability(['hello','world123x0'], ['com','net'], 1, 'create'); ``` ### Response #### Success Response (200) Returns an array of objects, each representing the availability status for a domain/TLD combination. Sample Response Object: - **TLD** (string) - **DomainName** (string) - **Status** (string) - 'available' or 'notavailable'. - **Command** (string) - **Period** (integer) - **IsFee** (string or null) - **Price** (string) - **Currency** (string) - **Reason** (string) - Reason for availability status (e.g., 'Domain exists'). ### Response Example ```json [ { "TLD": "com", "DomainName": "hello", "Status": "notavailable", "Command": "create", "Period": 1, "IsFee": null, "Price": "10.8100", "Currency": "USD", "Reason": "Domain exists" }, { "TLD": "com", "DomainName": "world123x0", "Status": "available", "Command": "create", "Period": 1, "IsFee": null, "Price": "10.8100", "Currency": "USD", "Reason": "" } ] ``` ``` -------------------------------- ### Update Child Nameserver Source: https://github.com/domainreseller/php-dna/blob/main/README.md Updates an existing child nameserver for a domain. ```APIDOC ## Update Child Nameserver ### Description Updates an existing child nameserver for a domain. ### Method ```php $dna->ModifyChildNameServer(string $domainName, string $nameServer, string $ipAddress) ``` ### Parameters #### Path Parameters - **domainName** (string) - Required - The name of the domain. - **nameServer** (string) - Required - The name of the child nameserver to update. - **ipAddress** (string) - Required - The new IP address for the child nameserver. ### Response #### Success Response (200) - **data** (array) - Contains the updated NameServer and its IPAdresses. - **result** (string) - Indicates the success of the operation ('OK'). ``` -------------------------------- ### Update Child Nameserver Source: https://github.com/domainreseller/php-dna/blob/main/README.md Modifies an existing child nameserver for a domain, updating its hostname and IP address. ```php $dna->ModifyChildNameServer('example.com', 'ns1.example.com', '1.2.3.4'); ``` -------------------------------- ### Enable Domain Theft Protection Lock Source: https://github.com/domainreseller/php-dna/blob/main/README.md Activates the domain lock to prevent unauthorized transfers. This is a security measure for domain protection. ```php $dna->EnableTheftProtectionLock('example.com'); ``` -------------------------------- ### Transfer Source: https://github.com/domainreseller/php-dna/blob/main/README.md Transfers a domain name to the reseller account using the authorization code. ```APIDOC ## Transfer ### Description Transfers a domain name to the reseller account using the authorization code. ### Method `Transfer(string $domainName, string $authCode, int $years)` ### Parameters #### Path Parameters - **domainName** (string) - Required - The domain name to transfer (e.g., 'example.com'). - **authCode** (string) - Required - The authorization code (EPP code) for the domain transfer. - **years** (int) - Required - The number of years to register the domain for upon transfer. ### Request Example ```php $dna->Transfer('example.com', 'Xy9#mK2$', 3); ``` ### Response #### Success Response (200) - **result** (string) - Indicates the status of the operation ('OK' or an error message). #### Response Example ```json { "result": "OK" } ``` ``` -------------------------------- ### Check Domain Availability Source: https://github.com/domainreseller/php-dna/blob/main/README.md Checks the availability of one or more domain names for a specified TLD and registration period. This function is essential for real-time domain registration services. ```php $dna->CheckAvailability(['hello','world123x0'], ['com','net'], 1, 'create'); ``` ```php Array ( [0] => Array ( [TLD] => com [DomainName] => hello [Status] => notavailable [Command] => create [Period] => 1 [IsFee] => [Price] => 10.8100 [Currency] => USD [Reason] => Domain exists ) [1] => Array ( [TLD] => com [DomainName] => world123x0 [Status] => available [Command] => create [Period] => 1 [IsFee] => [Price] => 10.8100 [Currency] => USD [Reason] => ) ) ``` -------------------------------- ### Modify Nameservers Source: https://github.com/domainreseller/php-dna/blob/main/README.md Updates the nameservers associated with a domain. ```APIDOC ## Modify Nameservers ### Description Updates the nameservers associated with a domain. ### Method ```php $dna->ModifyNameServer(string $domainName, array $nameServers) ``` ### Parameters #### Path Parameters - **domainName** (string) - Required - The name of the domain to modify. - **nameServers** (array) - Required - An array of nameservers to set for the domain. ### Response #### Success Response (200) - **data** (array) - Contains the updated NameServers list. - **result** (string) - Indicates the success of the operation ('OK'). ``` -------------------------------- ### Save Domain Contacts PHP Source: https://github.com/domainreseller/php-dna/blob/main/README.md Use this to save contact information for a domain. Ensure all required contact fields are populated. ```php $contact = [ "FirstName" => 'John', "LastName" => 'Doe', "Company" => 'Example Corp', "EMail" => 'john@example.com', "AddressLine1" => '123 Main Street', "AddressLine2" => '', "AddressLine3" => '', "City" => 'Springfield', "Country" => 'US', "Fax" => '5559876543', "FaxCountryCode" => '1', "Phone" => '5551234567', "PhoneCountryCode" => 1, "Type" => 'Contact', "ZipCode" => '62701', "State" => 'IL' ]; $dna->SaveContacts('example.com', [ 'Administrative' => $contact, 'Billing' => $contact, 'Technical' => $contact, 'Registrant' => $contact ]); ``` -------------------------------- ### Modify Domain Nameservers Source: https://github.com/domainreseller/php-dna/blob/main/README.md Updates the nameservers associated with a domain. Provide a list of valid nameserver hostnames. ```php $dna->ModifyNameServer('example.com', ['ns1.example.com', 'ns2.example.com']); ``` -------------------------------- ### Delete Child Nameserver Source: https://github.com/domainreseller/php-dna/blob/main/README.md Removes a child nameserver from a domain. The nameserver hostname must be specified. ```php $dna->DeleteChildNameServer('example.com', 'ns1.example.com'); ``` -------------------------------- ### Delete Child Nameserver Source: https://github.com/domainreseller/php-dna/blob/main/README.md Deletes a child nameserver from a domain. ```APIDOC ## Delete Child Nameserver ### Description Deletes a child nameserver from a domain. ### Method ```php $dna->DeleteChildNameServer(string $domainName, string $nameServer) ``` ### Parameters #### Path Parameters - **domainName** (string) - Required - The name of the domain. - **nameServer** (string) - Required - The name of the child nameserver to delete. ### Response #### Success Response (200) - **data** (array) - Contains the deleted NameServer. - **result** (string) - Indicates the success of the operation ('OK'). ``` -------------------------------- ### Renew a Domain Source: https://github.com/domainreseller/php-dna/blob/main/README.md Renew an existing domain name for a specified number of years. This operation updates the expiration date. ```php $dna->Renew('example.com', 1); ``` -------------------------------- ### Renew Source: https://github.com/domainreseller/php-dna/blob/main/README.md Renews a domain name for an additional year. ```APIDOC ## Renew ### Description Renews a domain name for an additional year. ### Method `Renew(string $domainName, int $years)` ### Parameters #### Path Parameters - **domainName** (string) - Required - The domain name to renew (e.g., 'example.com'). - **years** (int) - Required - The number of years to renew the domain for. ### Request Example ```php $dna->Renew('example.com', 1); ``` ### Response #### Success Response (200) - **result** (string) - Indicates the status of the operation ('OK' or an error message). - **data** (array) - Contains the new expiration date if successful. - **ExpirationDate** (string) - The new expiration date of the domain. #### Response Example ```json { "result": "OK", "data": { "ExpirationDate": "2025-03-15T10:00:00" } } ``` ``` -------------------------------- ### Disable Domain Lock Source: https://github.com/domainreseller/php-dna/blob/main/README.md Disables the theft protection lock for a domain, allowing transfers. ```APIDOC ## Disable Domain Lock ### Description Disables the theft protection lock for a domain. ### Method ```php $dna->DisableTheftProtectionLock(string $domainName) ``` ### Parameters #### Path Parameters - **domainName** (string) - Required - The name of the domain to unlock. ### Response #### Success Response (200) - **data** (array) - Contains the updated LockStatus. - **result** (string) - Indicates the success of the operation ('OK'). ``` -------------------------------- ### Disable Domain Theft Protection Lock Source: https://github.com/domainreseller/php-dna/blob/main/README.md Deactivates the domain lock, allowing for domain transfers. Ensure this is done intentionally. ```php $dna->DisableTheftProtectionLock('example.com'); ``` -------------------------------- ### Save Domain Contacts Source: https://github.com/domainreseller/php-dna/blob/main/README.md Saves contact information for a specified domain. This includes administrative, billing, technical, and registrant contacts. ```APIDOC ## Save Domain Contacts ### Description Saves contact information for a specified domain, including administrative, billing, technical, and registrant contacts. ### Method ```php SaveContacts(string $domain, array $contacts) ``` ### Parameters #### Path Parameters - **domain** (string) - The domain name for which to save contacts. - **contacts** (array) - An associative array containing contact details for each role (Administrative, Billing, Technical, Registrant). ### Request Example ```php $contact = [ "FirstName" => 'John', "LastName" => 'Doe', "Company" => 'Example Corp', "EMail" => 'john@example.com', "AddressLine1" => '123 Main Street', "AddressLine2" => '', "AddressLine3" => '', "City" => 'Springfield', "Country" => 'US', "Fax" => '5559876543', "FaxCountryCode" => '1', "Phone" => '5551234567', "PhoneCountryCode" => 1, "Type" => 'Contact', "ZipCode" => '62701', "State" => 'IL' ]; $dna->SaveContacts('example.com', [ 'Administrative' => $contact, 'Billing' => $contact, 'Technical' => $contact, 'Registrant' => $contact ]); ``` ### Response #### Success Response (200) - **result** (string) - Indicates the status of the operation, e.g., 'OK'. ``` -------------------------------- ### Modify Domain Privacy Protection Source: https://github.com/domainreseller/php-dna/blob/main/README.md Changes the privacy protection status for a domain. Set to 'true' to enable, 'false' to disable. A reason is required. ```php $dna->ModifyPrivacyProtectionStatus('example.com', true, 'Owner request'); ``` -------------------------------- ### Modify Domain Privacy Source: https://github.com/domainreseller/php-dna/blob/main/README.md Modifies the privacy protection status for a domain. ```APIDOC ## Modify Domain Privacy ### Description Modifies the privacy protection status for a domain. ### Method ```php $dna->ModifyPrivacyProtectionStatus(string $domainName, bool $enable, string $requestor) ``` ### Parameters #### Path Parameters - **domainName** (string) - Required - The name of the domain. - **enable** (bool) - Required - Set to true to enable privacy protection, false to disable. - **requestor** (string) - Required - The entity requesting the change (e.g., 'Owner request'). ### Response #### Success Response (200) - **data** (array) - Contains the updated PrivacyProtectionStatus. - **result** (string) - Indicates the success of the operation ('OK'). ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.