domainreseller / php-dna
DomainNameAPI PHP Library for Domain Management
v2.1.13
2025-04-07 23:45 UTC
Requires (Dev)
- phpunit/phpunit: ^9.0
README
TR








Installation and Integration Guide
Minimum Requirements
- PHP7.4 or higher (Recommended 8.1)
- PHP SOAPClient extension must be active.
A) Manual Usage
Download the files and examine the examples in the examples folder.
require_once __DIR__.'/src/DomainNameAPI_PHPLibrary.php'; $dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('username','password');
B) Composer ile entegrasyon için
composer require domainreseller/php-dna
require_once __DIR__.'/vendor/autoload.php'; $dna = new \DomainNameApi\DomainNameAPI_PHPLibrary('username','password');
Usage
Domain Registration Operations
Note: Additional parameters are required for .tr domains. The Additional parameter is used for domain names that require extra information like .tr.
$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' ]; $a->RegisterWithContactInfo( 'example.com', 1, [ 'Administrative' => $contact, 'Billing' => $contact, 'Technical' => $contact, 'Registrant' => $contact ], ["ns1.example.com", "ns2.example.com"], true, false, //Addional attributes sadece .tr domainler için gereklidir. [ 'TRABISDOMAINCATEGORY' => 1, 'TRABISCITIZIENID' => '12345678901', 'TRABISNAMESURNAME' => 'John Doe', 'TRABISCOUNTRYID' => '840', 'TRABISCITYID' => '17' ]);
Sample Output for Domain Registration
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+03:00 [Expiration] => 2025-03-15T10:00:00+03:00 [RemainingDays] => 365 ) [NameServers] => Array ( [0] => ns1.example.com [1] => ns2.example.com ) [Additional] => Array ( [TRABISDOMAINCATEGORY] => 1 [TRABISCITIZIENID] => 98765432109 [TRABISNAMESURNAME] => Jane Smith [TRABISCOUNTRYID] => 840 [TRABISCITYID] => 34 ) [ChildNameServers] => Array ( ) ) ) )
Domain Renewal
$dna->Renew('example.com', 1);
Sample Output for Domain Renewal
Array ( [result] => OK [data] => Array ( [ExpirationDate] => 2025-03-15T10:00:00+03:00 ) )
Domain Transfer
$dna->Transfer('example.com', 'Xy9#mK2$', 3);
Sample Output for Domain Transfer
Array ( [result] => OK )
Domain List
$dna->GetList(['OrderColumn'=>'Id', 'OrderDirection'=>'ASC', 'PageNumber'=>0,'PageSize'=>1000]);
Sample Output for Domain List
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+03:00 [Expiration] => 2025-03-15T10:00:00+03:00 [RemainingDays] => 365 ) [NameServers] => Array ( [0] => ns1.example.com [1] => ns2.example.com ) [Additional] => Array ( [TRABISDOMAINCATEGORY] => 1 [TRABISCITIZIENID] => 98765432109 [TRABISNAMESURNAME] => Jane Smith [TRABISCOUNTRYID] => 215 [TRABISCITYID] => 34 ) [ChildNameServers] => Array ( [0] => Array ( [Name] => ns1.example.com [IP] => 1.2.3.4 ) [1] => Array ( [Name] => ns2.example.com [IP] => 2.3.4.5 ) ) ) ) ) [result] => OK )
TLD List
$dna->GetTldList(100);
Sample Output for TLD List
Array ( [data] => Array ( [0] => Array ( [id] => 1971 [status] => Active [maxchar] => 63 [maxperiod] => 10 [minchar] => 3 [minperiod] => 1 [tld] => cc.bh [pricing] => Array ( [backorder] => Array ( [1] => 149.9900 ) [refund] => Array ( [1] => 149.9900 ) [restore] => Array ( [1] => 85.0000 ) [transfer] => Array ( [1] => 149.9900 ) [renew] => Array ( [1] => 149.9900 ) [registration] => Array ( [1] => 149.9900 ) ) [currencies] => Array ( [backorder] => USD [refund] => USD [restore] => USD [transfer] => USD [renew] => USD [registration] => USD ) ) [1] => Array ( [id] => 1956 [status] => Active [maxchar] => 63 [maxperiod] => 10 [minchar] => 3 [minperiod] => 1 [tld] => aaa.pro [pricing] => Array ( [backorder] => Array ( [1] => 156.2500 ) [refund] => Array ( [1] => 156.2500 ) [restore] => Array ( [1] => 80.0000 ) [transfer] => Array ( [1] => 156.2500 ) [renew] => Array ( [1] => 156.2500 ) [registration] => Array ( [1] => 156.2500 ) ) [currencies] => Array ( [backorder] => USD [refund] => USD [restore] => USD [transfer] => USD [renew] => USD [registration] => USD ) ) ) [result] => OK )
Domain Availability Check
$dna->CheckAvailability('example.com',1,'create');
Sample Output for Domain Availability Check
*Array ( [0] => Array ( [TLD] => com [DomainName] => hello [Status] => notavailable [Command] => create [Period] => 1 [IsFee] => [Price] => 9.9900 [Currency] => USD [Reason] => Domain exists ) [1] => Array ( [TLD] => net [DomainName] => world123x0 [Status] => available [Command] => create [Period] => 1 [IsFee] => [Price] => 12.9900 [Currency] => USD [Reason] => ) [2] => Array ( [TLD] => net [DomainName] => hello [Status] => notavailable [Command] => create [Period] => 1 [IsFee] => [Price] => 12.9900 [Currency] => USD [Reason] => Domain exists ) [3] => Array ( [TLD] => com [DomainName] => world123x0 [Status] => available [Command] => create [Period] => 1 [IsFee] => [Price] => 9.9900 [Currency] => USD [Reason] => ) )
Domain Details
$dna->GetDetails('example.com');
Sample Output for Domain Details
Array ( [data] => 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] => 2025-05-26T16:08:37 [Expiration] => 2027-05-26T16:08:37 [RemainingDays] => 449 ) [NameServers] => Array ( "ns1.example.com", "ns2.example.com" ) [Additional] => Array ( [TRABISDOMAINCATEGORY] => 1 [TRABISCITIZIENID] => 1112221111111 [TRABISNAMESURNAME] => "Bunyamin Mutlu" [TRABISCOUNTRYID] => 215 [TRABISCITYID] => 41 ) [ChildNameServers] => Array ( Array ( [Name] => 'ns1.example.com' [IP] =>'1.2.3.4' ) Array ( [Name] => 'ns2.example.com' [IP] =>'2.3.4.5' ) ) ) [result] => OK )
Nameserver Modification
$dna->ModifyNameServer('example.com', [ 'ns1'=>'ns1.example.com', 'ns2'=>'ns2.example.com' ]);
Sample Output for Nameserver Modification
Array ( [data] => Array ( [NameServers] => Array ( [ns1] => ns1.example.com [ns2] => ns2.example.com ) ) [result] => OK )
Enable Domain Lock
$lock = $dna->EnableTheftProtectionLock('example.com');
Sample Output for Enable Domain Lock
Array ( [data] => Array ( [LockStatus] => true ) [result] => OK )
Disable Domain Lock
$lock = $dna->DisableTheftProtectionLock('example.com');
Sample Output for Disable Domain Lock
Array ( [data] => Array ( [LockStatus] => false ) [result] => OK )
Add Child Nameserver
$dna->AddChildNameServer('example.com', 'ns1.example.com', '1.2.3.4');
Sample Output for Add Child Nameserver
Array ( [data] => Array ( [NameServer] => test5.example.com [IPAdresses] => Array ( [0] => 1.2.3.4 ) ) [result] => OK )
Delete Child Nameserver
$dna->DeleteChildNameServer('example.com', 'test5.example.com');
Sample Output for Delete Child Nameserver
Array ( [result] => OK )
Update Child Nameserver
$dna->ModifyChildNameServer('example.com', 'test5.example.com', '1.2.3.4');
Sample Output for Update Child Nameserver
Array ( [data] => Array ( [NameServer] => test5.example.com [IPAdresses] => Array ( [0] => 1.2.3.4 ) ) [result] => OK )
Modify Domain Privacy
$lock = $dna->ModifyPrivacyProtectionStatus('example.com', true, 'owners optional comment');
Sample Output for Modify Domain Privacy
Array ( [result] => OK [data] => => Array ( [PrivacyProtectionStatus] =>trıe ) )
Save Domain Contact
$contact = [ "FirstName" => 'Bunyamin', "LastName" => 'Mutlu', "Company" => '', "EMail" => 'bun.mutlu@gmail.com', "AddressLine1" => 'adres 1 adres 1 adres 1 ', "AddressLine2" => 'test test', "AddressLine3" => '', "City" => 'Kocaeli', "Country" => 'TR', "Fax" => '2626060026', "FaxCountryCode" => '90', "Phone" => '5555555555', "PhoneCountryCode" => 90, "Type" => 'Contact', "ZipCode" => '41829', "State" => 'GEBZE' ]; $dna->SaveContacts('example.com','ns1','1.2.3.4');
Sample Output for Save Domain Contact
Array ( [result] => OK )
Get Reseller Details
$dna->GetResellerDetails();
Sample Output for Get Reseller Details
Array ( [result] => OK [id] => 12345 [active] => 1 [name] => TEST ACCOUNT 1 [balance] => 0.0000 [currency] => USD [symbol] => $ [balances] => Array ( [0] => Array ( [balance] => 0.0000 [currency] => USD [symbol] => $ ) [1] => Array ( [balance] => 0.0000 [currency] => TL [symbol] => TL ) ) )
Return and Error Codes with Descriptions
Code | Description | Detail |
---|---|---|
1000 | Command completed successfully | Operation successful. |
1001 | Command completed successfully; action pending | Operation successful. However, the operation is currently queued for completion. |
2003 | Required parameter missing | Parameter missing error. For example, no phone entry in contact information. |
2105 | Object is not eligible for renewal | Domain status is not suitable for renewal, locked for update operations. Status should not be "clientupdateprohibited". May be due to other status conditions. |
2200 | Authentication error | Authorization error, security code is incorrect or domain is registered with another registrar. |
2302 | Object exists | Domain name or nameserver information already exists in database. Cannot be registered. |
2303 | Object does not exist | Domain name or nameserver information does not exist in database. New registration required. |
2304 | Object status prohibits operation | Domain status is not suitable for updates, locked for update operations. Status should not be "clientupdateprohibited". May be due to other status conditions. |
CODE | DETAIL |
---|---|
101 | System Error Detailed For ({0})! |
102 | Multiple Errors Detailed For ({0})! |
103 | Unknown Errors Detailed For ({0})! |
200 | API command not found ({0})! |
210 | API service not found ({0})! |
211 | API service provider not set! |
300 | Reseller not found! |
301 | Your current IP address is not authorized to access. Please make sure you are connecting from an authorized IP address and try again |
310 | TLD is not supported! |
320 | API not found! |
321 | Currency is not supported! |
330 | Required parameter(s) not set ({0}). |
– | Make sure you send all contact objects full |
340 | Price definition not found ({0}[{1}]-{2}{3}). |
350 | Insufficent reseller balance. (Reseller Id : {0} - Current Balance : {1} {2}). |
350 | Accounting currency does not match or the balance is not sufficient. |
360 | Invalid API request for field ({0}). |
360 | API quota exceeded! |
361 | Throttled error! |
362 | Premium domain is not available to register right now. |
363 | Operation cancelled because domain in auto-renewal period |
364 | This domain is currently unavailable for transaction due to a problem with the registry |
CODE | DETAIL |
---|---|
400 | Invalid contact ({0}). |
401 | Contact info can not sync. |
402 | No access to contact information from registry. |
403 | THE SYSTEM HAS MISSING INFORMATION. ENTER YOUR DEFAULT INFORMATION OR CONTACT SUPPORT TEAM. |
404 | DOMAIN CONTACT CANNOT UPDATE. PERMISSION FROM THE REGISTRY. |
410 | Contact not found. |
410 | Contact not found ({0}). |
420 | Invalid Api command for contact {0}. |
430 | Contact api not found. |
440 | Contact is not synced. |
450 | Too many domain contacts.. ! |
451 | Failed to proceed with contact update. |
CODE | DETAIL |
---|---|
500 | Invalid domain id. |
500 | Invalid domain id ({0}). |
501 | Domain could not synchronized({0}) |
502 | Internal transfer failed |
503 | Domain registration is not available. |
504 | Domain information does not match .. Before :{0} |
505 | Enter the Ip Address. |
506 | Domain Transfer Has Been Started But Contact Info Not Read .. |
507 | Authorization error. |
510 | Domain not found. |
511 | Expried domains cannot be found. |
512 | Domain is not renewalable. |
513 | Domain is not in updateable status. It must be active for to be updated |
514 | Redemption Period Expected. |
520 | Invalid Api command for domain "{0}". |
530 | Invalid domain period. Period must be {0} to {1} years. Requested period is {2} years. |
540 | Domain cannot be extended beyond {0} years from current date. |
550 | Invalid domain name. Domain must be {0} to {1} characters length. Requested domain name is {2} characters. |
560 | Invalid name server count. Domain must have {0} to {1} name servers. Requested name server count is {2}. |
561 | No name server information found in the incoming request |
570 | Idn not supported for tld "{0}". |
571 | Period invalid. |
572 | Command invalid. |
573 | Domain names not found. |
574 | TLD names not found. |
575 | Domain is not in updateable status. It must be active for name servers to be updated |
576 | Domain can be renewed in the last 1 month before the expire date |
580 | Transfer not supported for tld "{0}". |
581 | Child name server not found |
582 | Transfer started by other reseller. |
583 | Transfer not initalized. Please contact the support team. |
584 | Object status prohibits operation |
590 | Auth code is required for this transfer. |
591 | Auth code is not valid. |
592 | Transfer lock exists on domain. |
593 | Domain cannot be transferred, Status Information and Transfer Lock must comply with the required criteria. (Status Information: #ok) |
594 | Domain name server adress could not resolved ({0}) |
595 | Contact information can not be read (whois.registrar.tld) Please make sure that privacy protection status open |
596 | Contact information could not verified |
597 | Tld Not Found |
598 | Unknown error occurred |
599 | Domain Forward Not Found |