The API (Application Programming Interface) allow you to manage your domain name from software write in your favorite language. (We provide examples for PHP et Perl.)
Since Jan, 29 2007 the following TLD can be managed by the API :
| Top Level Domain (TLD) | Registry | Price example for domain name create |
|---|---|---|
| .COM | Verisign GRS | 5,00 € without taxes |
| .NET | Verisign GRS | 5,00 € without taxes |
| .ORG | PIR | 5,00 € without taxes |
| .BIZ | NeuLevel | 5,00 € without taxes |
| .INFO | Afilias | 5,00 € without taxes |
| .NAME | GNR | 5,00 € without taxes |
| .MOBI | dotMobi | 10,00 € without taxes |
| .EU | EurID | 5,00 € without taxes |
| .FR (France) | AFNIC | 5,00 € without taxes |
| .BE (Belgique) | Dns.BE | 5,00 € without taxes |
| .US (USA) | NeuStar | 10,00 € without taxes |
| .CN (Chine) | CNNIC | 10,00 € without taxes |
| .TW (Taiwan) | TWNIC | 15,00 € without taxes |
| .ASIA | DotAsia | 10,00 € without taxes |
| .CO.UK | Nominet | soon |
| .ORG.UK | Nominet | soon |
| .ME.UK | Nominet | soon |
This API is used since 2006 October by resellers managing more than 100,000 domain names.
The API is reserved for reseller with a minimuum of 10 domains create by month.
4 Steps to become reseller:
and IP address used to connect to our API servers.Servers and services
We provide API usage examples for PHP and Perl language.
PHP required : PHP 5.1 + Soap Client
Perl required : Perl 5 + SOAP::Lite >= 0.67
From the API there’s functions domain_check and domain_multicheck, but we also provide acces to a DAS server (Domain Availability Service).
For TLDs (.COM .NET .ORG .BIZ .INFO .NAME .MOBI .US .FR)
| Plateform | Hostname | Port TCP |
|---|---|---|
| OT&E | das.dev.free.org | 4343 |
| Production | das.free.org | 4343 |
For ccTLD .BE (service provided directly from Dns.BE registry)
| Plateform | Hostname | Port TCP |
|---|---|---|
| Production | whois.dns.be | 4343 |
For ccTLD .EU (service provided directly from EurID registry)
| Plateform | Hostname | Port TCP |
|---|---|---|
| Production | das.be | 4343 |
Documentation: http://registrar.eurid.eu/en/registrar/registrar-content/das-domain-availability-service
How to use DAS server from Linux/FreeBSD: $ whois -h das.free.org -p 4343 “get 1.0 mondomaine-a-moi.org”
| Plateform | Hostname | Port TCP |
|---|---|---|
| OT&E | api.dev.free.org | 80 |
| Production | api.free.org | 80 or 443 |
If your domain name is include in your DNS hostname, you must provide IP address to the registry managing your domain TLD.
Example:
| DNS hostname | ns0.free.org |
| domain name | free.org |
ns0.free.org IP address must be provided to the registry managing the .org TLD (PIR).
All API host_* function is designed to manage this kind of registration, also called ‘glue record’.
| fields | values | descriptions |
|---|---|---|
| registry_status | 0×01 | clientDeleteProhibited |
| registry_status | 0×02 | serverDeleteProhibited |
| registry_status | 0×04 | clientHold |
| registry_status | 0×08 | serverHold |
| registry_status | 0×10 | clientRenewProhibited |
| registry_status | 0×20 | serverRenewProhibited |
| registry_status | 0×40 | clientTransferProhibited |
| registry_status | 0×80 | serverTransferProhibited |
| registry_status | 0×100 | clientUpdateProhibited |
| registry_status | 0×200 | serverUpdateProhibited |
| registry_status | 0×400 | pendingCreate |
| registry_status | 0×800 | pendingDelete |
| registry_status | 0×1000 | pendingRenew |
| registry_status | 0×2000 | pendingTransfer |
| registry_status | 0×4000 | pendingUpdate |
All functions return an array (key/value)
"retcode" => integer "retval" => integer "retfields" => array
* “retcode” and “retval” key are ALWAYS available.
if “retcode” is different of 1 ⇒ there’s a probleme (check retval value)
* “retfields” array is available in many case and usefull to check result of request.
WARNING, YOU ** MUST ** check the process operation state by
api_status for each following command:
As well we will suggest you, to archive all request/reply from the API.
API variables used in this document examples:
$dist_id = reseller login id $dist_passwd = reseller password $domain = domain name (.com .net .org .biz .info .name .eu .be .us .fr) $period = year number (from 1 to 10) $id = contact ID $handle = contact handle $tid = transaction ID (to check the operation state) 'status' can be one of the following enum('Wait','ToProcess','Done','Error') $array_domain = array( "domain" => $domain, // domain name "period" => 1, // 1 year registration "owner_id" => $id, // contact ID "admin_id" => $dist_id, // Contact Admin = reseller? "tech_id" => $dist_id, // Contact Technique = reseller? "bill_id" => $dist_id, // Contact Billing = reseller? "service" => "dns", // dns or dnsslave "ip_dns_master" => "", // if dnsslave => provide master IP "ns0" => "ns0.online.net", // up to 13 DNS for update "ns1" => "ns1.online.net" // or maxi 4 for create // fields only used by domain_update(); "registry_status" => 0, // Example: 64=clientTransferProhibited "authinfo" => "EPPauthCode" // EPP AuthCode change ); $array_contact = ( "passwd" => "tres-secret", "email" => "dupond@free.fr", "hash_email" => "yes", // yes no "formejuridique" => "particulier", // from enum('Particulier','Societe','Association','Autre') "civilite" => "M", // from enum('','M','Mme','Mle') "nom" => "DUPOND", "prenom" => "Pierre", "societe" => "", "adresse1" => "12 Rue du chien qui fume", "adresse2" => "", "cp" => "75001", "ville" => "PARIS", "region_id" => "", // voir api_regionid() "pays_id" => "1", // voir api_paysid() "telephone" => "+33.147010203", "telecopie" => "", "numero_tva" => "", "siret" => "", "lang" => "fr", // fr en de es "revente" => "no", // yes no // NEXUS (only usefull for .US registration) "dotus_nexus_purpose" => "", // Purpose // P1 Business // P2 Non-Profit Business // P3 Personal Use // P4 Education // P5 Goverment "dotus_nexus_category" => "", // Category // C11 U.S. Citizen // C12 U.S. Permanent Resident // C21 U.S. Organization Incorprated in U.S. // C31 Non-US: Regularly engages in lawful activities in U.S. // C32 Non-US: Entity has an office or other facility in U.S. // FR Extensions (only usefull for .FR registration) // .FR Registry authenticate owner of domain name, so you must choose // and authentication method (WARNING, check 'formejuridique' to be // sure of non-stupid choice, otherwise AFNIC will reject your request) "dotfr_mode" => "", // enum('MARQUE','SIRET','PARTICULIER','ASSOCIATION') "dotfr_marque" => "", // French INPI trademark registration number // private individual "dotfr_ne_le" => "", // birth date : (JJ-MM-AAAA) "dotfr_ne_cp" => "", // birth zip code "dotfr_ne_ville" => "", // birth town "dotfr_ne_pays_id" => "1", // birth country - voir api_paysid(); // for french "association loi 1901" "dotfr_publication_jo" => "", // date de publication au journal officiel sous la forme: (JJ-MM-AAAA) "dotfr_publication_jo_page" => "", // numero de page de la publication au journal officiel // .ASIA Extensions (only usefull for .ASIA registration) for more information: // http://registry.asia/policies/DotAsia-Charter-Eligibility--COMPLETE-2007-08-15.pdf "asia_locality" => "", // pays_id country in Asie,Australia,Pacific area "asia_typeofentity" => "", // enum('naturalPerson','corporation','cooperative','partnership','government','politicalParty','society','institution') "asia_formofident" => "", // enum('passport','certificate','legislation','societyRegistry','politicalPartyRegistry') "asia_identnumber" => "", // );
Before all operation, you must construct a SoapClient object.
PHP Example 5.1:
$client = new SoapClient( NULL, array( 'location' => "http://api.dev.free.org/apis.cgi", 'uri' => "http://api.dev.free.org/apis.cgi", 'encoding'=>'UTF-8' ) );
Perl Example:
use SOAP::Lite; my $client = SOAP::Lite -> uri('http://api.dev.free.org/apis.cgi') -> proxy('http://api.dev.free.org/apis.cgi');
Contacts management
Prototype:
function contact_create( $dist_id, $dist_passwd, $array_contact )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | Unable to create contact (Handle) |
| -1 | -3 | Bad type for $array_contact |
| -1 | -4 | Missing elements in $array_contact |
| 0 | 0 | ID doesn’t exist |
| 1 | ID | OK (return contact array in retfields[]) |
[retcode] => 1 [retval] => 151049 [retfields] => Array ( [id] => 151049 [parent_id] => 13490 [lastupdate] => 2006-09-26 21:42:59 [lastupdate_ip] => 88.191.249.162 [handle] => PD86-FREE [creation] => 2006-09-26 21:42:59 [email] => dupond@free.fr [md5_email] => eb94fe20.151049@contacts.nospam.free.org [hash_email] => yes [formejuridique] => Particulier [civilite] => M [nom] => DUPOND [prenom] => Pierre [societe] => [adresse1] => 12 Rue du chien qui fume [adresse2] => [cp] => 75001 [ville] => PARIS [pays_id] => 1 [telephone] => +33.147010203 [telecopie] => [numero_tva] => [siret] => [lang] => fr [revente] => no [status] => Active [pays] => FRANCE )
PHP Example:
/* Contact create --------------------------------------------- */ $newcontact = array ( "passwd" => "coincoin", "email" => "dupond@free.fr", // yes/no "hash_email" => "yes", // enum('Particulier','Societe','Association','Autre') "formejuridique" => "particulier", // enum('','M','Mme','Mle') "civilite" => "M", "nom" => "DUPOND", "prenom" => "Pierre", "societe" => "", "adresse1" => "12 Rue du chien qui fume", "adresse2" => "", "cp" => "75001", "ville" => "PARIS", // voir api_regionid() "region_id" => "", // voir api_paysid() "pays_id" => "1", "telephone" => "+33.147010203", "telecopie" => "", "numero_tva" => "", "siret" => "", // fr en de es "lang" => "fr", // yes/no "revente" => "no", // NEXUS (utile uniquement pour l'enregistrement de .US) "dotus_nexus_purpose" => "", // "P1" Business // "P2" Non-Profit Business // "P3" Personal Use // "P4" Education // "P5" Goverment "dotus_nexus_category" => "", // "C11" U.S. Citizen // "C12" U.S. Permanent Resident // "C21" U.S. Organization Incorprated in U.S. // "C31" Non-US: Regularly engages in lawful activities in U.S. // "C32" Non-US: Entity has an office or other facility in U.S. // Extensions (utile uniquement pour lenregistrement de .FR) // choix de la methode d'authentification par l'AFNIC "dotfr_mode" => "", // enum('MARQUE','SIRET','PARTICULIER','ASSOCIATION') "dotfr_marque" => "", // une marque de l'INPI or OHMI // pour un particulier "dotfr_ne_le" => "", // date de naissance sous la forme: (JJ-MM-AAAA) "dotfr_ne_cp" => "", // code postal du lieu de naissance "dotfr_ne_ville" => "", // ville du lieu de naissance "dotfr_ne_pays_id" => "1", // pays du lieu de naissance - voir api_paysid(); // pour une association loi 1901 "dotfr_publication_jo" => "", // date de publication au journal officiel sous la forme: (JJ-MM-AAAA) "dotfr_publication_jo_page" => "", // numero de page de la publication au journal officiel ); echo "contact_create() \n"; $result = $client->contact_create( $dist_id, $dist_passwd, $newcontact ); print_r( $result ); if ( $result['retcode'] != 1 ) die( "Ca ne fonctionne pas !" );
Perl Example:
# Contact Create my $contact_id; my %newcontact = ( # force type string pour eviter la conversion en float 'passwd' => SOAP::Data->type(string =>'coincoin'), 'email' => 'dupond@free.fr', # yes/no 'hash_email' => 'yes', # enum('Particulier','Societe','Association','Autre') 'formejuridique' => 'particulier', # enum('','M','Mme','Mle') 'civilite' => 'M', 'nom' => 'DUPOND', 'prenom' => 'Pierre', 'societe' => '', 'adresse1' => '12 Rue du chien qui fume', 'adresse2' => '', 'cp' => SOAP::Data->type(string =>'75001'), 'ville' => 'PARIS', # voir api_regionid() 'region_id' => '', # voir api_paysid() 'pays_id' => '1', # force type string pour eviter la conversion en float 'telephone' => SOAP::Data->type(string =>'+33.147010203'), 'telecopie' => SOAP::Data->type(string => ''), 'numero_tva' => '', 'siret' => SOAP::Data->type(string =>''), 'lang' => 'fr', 'revente' => 'no', # NEXUS (utile uniquement pour l'enregistrement des .US 'dotus_nexus_purpose' => '', # "P1" Business # "P2" Non-Profit Business # "P3" Personal Use # "P4" Education # "P5" Goverment 'dotus_nexus_category' => '', # C11" U.S. Citizen # "C12" U.S. Permanent Resident # "C21" U.S. Organization Incorprated in U.S. # "C31" Non-US: Regularly engages in lawful activities in U.S. # "C32" Non-US: Entity has an office or other facility in U.S. ); print "contact_create\n"; $result = $client->contact_create( $dist_id, $dist_passwd, SOAP::Data->type(map =>\%newcontact)); if ($result->result->{'retcode'} !=1) { die "Ca ne fonctionne pas create!\n"; }; $contact_id = $result->result->{'retval'};
Prototype:
function contact_update( $dist_id, $dist_passwd, $id, $array_contact )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | Access denied ($dist_id need more right to manage $id) |
| -1 | -3 | $id status != ‘Active’ (Deleted, Suspended, UDRP, etc.) |
| -1 | -4 | bad type $array_contact |
| -1 | -5 | Missing elements in $array_contact |
| 0 | 0 | ID doesn’t exist |
| 1 | ID | OK (return contact array in retfields[]) |
[retcode] => 1 [retval] => 151049 [retfields] => Array ( [id] => 151049 [parent_id] => 13490 [lastupdate] => 2006-09-26 21:42:59 [lastupdate_ip] => 88.191.249.162 [handle] => PD86-FREE [creation] => 2006-09-26 21:42:59 [email] => dupond@free.fr [md5_email] => eb94fe20.151049@contacts.nospam.free.org [hash_email] => yes [formejuridique] => Particulier [civilite] => M [nom] => DUPONT [prenom] => Pierre [societe] => [adresse1] => 12 Rue du chien qui fume [adresse2] => [cp] => 75001 [ville] => PARIS [pays_id] => 1 [telephone] => +33.147010203 [telecopie] => +33.173500000 [numero_tva] => [siret] => [lang] => fr [revente] => no [status] => Active [pays] => FRANCE )
PHP Example:
/* Update d'un contact ---------------------------------------------- */ // $result = resultat d'un contact_info() $contact_id = $result['retval']; $updcontact = $result['retfields']; $updcontact['nom'] = "DUPONT"; $updcontact['telecopie'] = "+33.173500000"; echo "contact_update() \n"; $result = $client->contact_update( $dist_id, $dist_passwd, $contact_id, $updcontact ); print_r( $result ); if ( $result['retcode'] != 1 ) die( "Ca ne fonctionne pas !" );
Perl Example:
# Update d'un contact $updcontact{'nom'} = 'DUPONT'; $updcontact{'telecopie'} = SOAP::Data->type(string =>'+33.173500000'); print "contact_update\n"; $result = $client->contact_update( $dist_id, $dist_passwd, $contact_id, SOAP::Data->type(map => \%updcontact )); if ($result->result->{'retcode'} !=1) { die "Ca ne fonctionne pas !\n"; };
Prototype:
function contact_delete( $dist_id, $dist_passwd, $id )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | $dist_id n’a pas les droits nécessaires pour agir sur $id |
| -1 | -3 | l’ID est utilisé par un domain name |
| 0 | 0 | l’ID n’existe pas |
| 1 | ID | OK (retourne aussi un tableau retfield[]) |
PHP Example:
/* Delete d'un contact ---------------------------------------------- */ echo "contact_delete()\n"; $result = $client->contact_delete( $dist_id, $dist_passwd, $id ); print_r( $result ); if ( $result['retcode'] != 1 ) die( "Ca ne fonctionne pas !" );
Perl Example:
# Delete d'un contact print "contact_delete\n"; $result = $client->contact_delete( $dist_id, $dist_passwd, $contact_id ); print Data::Dumper->Dump([$result->result]);
Prototype:
function contact_info( $dist_id, $dist_passwd, $handle, $id )
fournir $handle OU ($id avec $handle vide)
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| 0 | 0 | $id or $handle doesn’t existe |
| 1 | ID | OK (return array retfields[]) |
[retcode] => 1 [retval] => 151049 [retfields] => Array ( [id] => 151049 [parent_id] => 13490 [lastupdate] => 2006-09-26 21:42:59 [lastupdate_ip] => 88.191.249.162 [handle] => PD86-FREE [creation] => 2006-09-26 21:42:59 [email] => dupond@free.fr [md5_email] => eb94fe20.151049@contacts.nospam.free.org [hash_email] => yes [formejuridique] => Particulier [civilite] => M [nom] => DUPONT [prenom] => Pierre [societe] => [adresse1] => 12 Rue du chien qui fume [adresse2] => [cp] => 75001 [ville] => PARIS [pays_id] => 1 [telephone] => +33.147010203 [telecopie] => +33.173500000 [numero_tva] => [siret] => [lang] => fr [revente] => no [status] => Active [pays] => FRANCE )
PHP Example:
/* Info a propos d'un contact --------------------------------------- */ echo "contact_info()\n"; $id = 123; $result = $client->contact_info( $dist_id, $dist_passwd, "", $id ); print_r( $result ); echo "contact_info() par handle du type 'QQQ123-FREE'\n"; $handle = "QQQ123-FREE"; $result = $client->contact_info( $dist_id, $dist_passwd, $handle ); print_r( $result );
Perl Example:
# Info a propos d'un contact print "contact_info id\n"; $result = $client->contact_info( $dist_id, $dist_passwd, '', $contact_id ); print Data::Dumper->Dump([$result->result->{'retfields'}]); if ($result->result->{'retcode'} !=1) { die "Ca ne fonctionne pas contact_info\n"; }; %updcontact = %{$result->result->{'retfields'}}; my $handle = $result->result->{'retfields'}->{'handle'}; print "contact_info handle $handle\n"; $result = $client->contact_info( $dist_id, $dist_passwd, $handle ); print Data::Dumper->Dump([$result->result->{'retfields'}]);
Prototype:
function contact_list( $dist_id, $dist_passwd )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| 0 | 0 | no contact |
| 1 | ID | OK (return array retfields[]) |
PHP Example:
/* Liste les contacts cree par le reseller $dist_id ---------------- */ echo "contact_list()\n"; $result = $client->contact_list( $dist_id, $dist_passwd ); print_r( $result );
Perl Example:
# Liste les contacts cree par le reseller $dist_id print "contact_list()\n"; $result = $client->contact_list( $dist_id, $dist_passwd ); print Data::Dumper->Dump([$result->result->{'retfields'}]);
Domain names management
Prototype:
function domain_check( $dist_id, $dist_passwd, $domain )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | Domain name not available (allready in our database) |
| -1 | -3 | We do not manage this domaine name TLD |
| -1 | -4 | Domain name unavaible from registry |
| -1 | -5 | Domain name undefined |
| 1 | 1 | Domain name IS avaiable |
[retcode] => 1 [retval] => 1
PHP Example:
/* Controle la disponibilite d'un domain name -------------------- */ $domain = sprintf( "mydomaine-%d.com", time() ); echo "domain_check() $domain\n"; $result = $client->domain_check( $dist_id, $dist_passwd, $tdomain ); print_r( $result );
Perl Example:
# Controle la disponibilite d'un domain name print "domain_check()\n"; my $name= sprintf( "demo-now-%d", time() ); my @adomain = map { "$name.".$_ } ('com','net','org','info','biz','name','us','eu'); foreach my $domain (@adomain) { $result = $client->domain_check($dist_id, $dist_passwd,$domain); print "$domain\n"; print Data::Dumper->Dump([$result->result]); };
Prototype:
function domain_multicheck( $cid, $passwd, $domain )
$domain doit être fourni sans TLD
Valeur de retour:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | Domain name undefined |
| 1 | 1 | One or severals domain names are availbles (check retfields[]) |
For each TLD (1 = avaiable, 0 = unavailable)
[retcode] => 1 [retval] => 1 [retfields] => Array ( [com] => 0 [net] => 1 [org] => 0 [biz] => 1 [info] => 1 [mobi] => 1 [pro] => 1 [name] => 1 [us] => 1 [eu] => 0 [be] => 1 [fr] => 1 [cn] => 1 )
PHP Example:
/* Controle la disponibilite d'un domain name -------------------- */ /* pour l'ENSEMBLE des TLDs gere par l'API -------------------------- */ $domain = sprintf( "mydomain-now-%d", time() ); $result = $client->domain_multicheck( $dist_id, $dist_passwd, $domain ); print_r( $result );
Perl Example:
# Controle la disponibilite d'un domain name # pour l'ENSEMBLE des TLDs gere par l'API print "domain_multicheck()\n"; my $name= sprintf( "mydomain-now-%d", time() ); $result = $client->domain_multicheck( $dist_id, $dist_passwd, $name); print Data::Dumper->Dump([$result->result]);
Prototype:
function domain_create( $dist_id, $dist_passwd, $array_domain )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | Domain name unavailable |
| -1 | -3 | Missing elements in array $array_domain |
| -1 | -4 | owner_id or admin_id or tech_id or bill_id was not usable |
| -1 | -5 | Undefined domain name |
| -1 | -6 | Missing elements from $owner_id to be able to create .US or .FR |
| -1 | -7 | Invalid DNS or DNS Zone for .FR invalid ZoneCheck |
| 1 | TID | (transaction ID used by api_status() ) |
WARNING, you ** MUST ** check the operation processing state by api_status.
[retcode] => 1 [retval] => 277 [retfields] => Array ( [tid] => 277 [id] => 141958 [lastupdate] => 2006-09-26 21:43:09 [lastupdate_ip] => 88.191.249.162 [domain] => demo-now-1159299779.com [registrar_creation] => 0000-00-00 00:00:00 [registrar_expiration] => 0000-00-00 00:00:00 [authinfo] => hqruzKPTYZ13 [service] => dns [status] => Active [registry_status] => 0 [ns0] => ns0.online.net [ns1] => ns1.online.net [bill_id] => 13490 [tech_id] => 13490 [admin_id] => 13490 [owner_id] => 151049 )
PHP Example:
/* Creation d'un domain name ------------------------------------- */ $domain = sprintf( "mydomaine-%d.com", time() ); $newdomain = array( "domain" => $domain, // domain name "period" => 1, // enregistrement pour 1 an "owner_id" => $id, // contact ID cree dans le meme exemple "admin_id" => $admin_id, // Contact Admin = reseller "tech_id" => $tech_id, // Contact Technique = reseller "bill_id" => $bill_id, // Contact Billing = reseller "service" => "dns", // dns or dnsslave "ip_dns_master" => "", // si dnsslave => fournir l'IP du master "ns0" => "ns0.online.net", "ns1" => "ns1.online.net", // jusqu'a 4 DNS possible (13 en update) "ipns0" => "", "ipns1" => "", // glue record si besoin // les fields suivant sont uniquement utilise par domain_update(); "registry_status" => 0, // clientTransferProhibited on/off "authinfo" => "EPPauthCode" // EPP AuthCode ); echo "domain_create() \n"; $result = $client->domain_create( $dist_id, $dist_passwd, $newdomain ); print_r( $result ); if ( $result['retcode'] != 1 ) die( "Ca ne fonctionne pas !" );
Perl Example:
my $tid; my %newdomain; # Creation d'un domain name print "domain_create\n"; my $domain= 'demo-now-'.time()."-$$.com"; %newdomain =( "domain" => $domain, # domain name "period" => 1, # enregistrement pour 1 an "owner_id" => $contact_id, # contact ID cree dans le meme exemple "admin_id" => $dist_id, # Contact Admin = reseller "tech_id" => $dist_id, # Contact Technique = reseller "bill_id" => $dist_id, # Contact Billing = reseller "service" => "dns", # dns or dnsslave "ip_dns_master" => "", # si dnsslave => fournir l'IP du master "ns0" => "ns0.online.net", "ns1" => "ns1.online.net", # jusqu'a 13 DNS possible "ns2" => "ns0.$domain", # dns avec glue => fournir son IP "ips2" => "213.228.62.20" ); $result = $client->domain_create( $dist_id, $dist_passwd, SOAP::Data->type(map => \%newdomain )); print Data::Dumper->Dump([$result->result]); if ($result->result->{'retcode'} !=1) { die "Ca ne fonctionne pas !\n"; }; $tid = $result->result->{'retval'};
Prototype:
function domain_renew( $dist_id, $dist_passwd, $domain, $period )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | |
| -1 | -3 | bad period |
| -1 | -4 | undefined domain name |
| 0 | 0 | Domain name doesn’t exist in our database |
| 1 | TID | (OK check ‘tid’ transaction ID used by api_status() ) |
domain_renew() Acces denied
Renew operation is denied in case of the following domain status:
clientRenewProhibited serverRenewProhibited clientUpdateProhibited serverUpdateProhibited pendingCreate pendingDelete pendingRenew pendingTransfer pendingUpdate
PHP Example:
/* Renouvellement d'un domain name -------------------------------- */ $period = 5; // Renouvellement pour 5 ans echo "domain_renew() \n"; $result = $client->domain_renew( $dist_id, $dist_passwd, $newdomain['domain'], $period ); print_r( $result ); if ( $result['retcode'] != 1 ) die( "Ca ne fonctionne pas !" ); $tid = $result['retfields']['tid']; echo "api_status() transaction $tid\n"; $result = $client->api_status( $dist_id, $dist_passwd, $tid ); print_r( $result );
Perl Example:
# Renouvellement d'un domain name print "domain_renew()\n"; my $period = 5; # Renouvellement pour 5 ans; $result = $client->domain_renew( $dist_id, $dist_passwd, $newdomain{'domain'}, $period ); print Data::Dumper->Dump([$result->result]); if ($result->result->{'retcode'} !=1) { die "Ca ne fonctionne pas !\n"; }; $tid = $result->result->{'retval'};
Prototype:
function domain_update( $dist_id, $dist_passwd, $domain, $array_domain )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | |
| -1 | -3 | Missing elements in array $array_domain |
| -1 | -4 | owner_id or admin_id or tech_id or bill_id was not usable |
| -1 | -5 | Domain name undefined |
| -1 | -6 | DNS was not properly setup for .FR (check: http://www.afnic.fr/outils/zonecheck/) |
| -1 | -7 | Invalid DNS or DNS Zone for .FR invalid ZoneCheck |
| 0 | 0 | Domain name doesn’t exist in our database |
| 1 | TID | (OK check ‘tid’ transaction ID used by api_status() ) |
[retcode] => 1 [retval] => 278 [retfields] => Array ( [tid] => 278 )
domain_update() Acces denied
admin_id / tech_id / bill_id are updatable only if $dist_id == $owner_id or $dist_id == $admin_id Update operation is denied in case of the following domain status: clientUpdateProhibited serverUpdateProhibited pendingCreate pendingDelete pendingRenew pendingTransfer pendingUpdate
PHP Example:
/* Update d'un domain name ---------------------------------------- */ // un exemple de $newdomain est defini dans domain_create $upddomain = $newdomain; // il est possible de definir jusqu'a 13 DNS $upddomain['ns1'] = "ns0.free.org"; $upddomain['ns2'] = "ns1.free.org"; // Changement de contact Technique $upddomain['tech_id'] = $tech_id; // Changement de contact de Billing $upddomain['bill_id'] = $bill_id; // 64 = Transfer Prohibited, 0 = Transfer Granted $upddomain['registry_status'] = 64; // Changement de l'AuthCode EPP $upddomain['authinfo'] = "NewEPPcode"; echo "domain_update() \n"; $result = $client->domain_update( $dist_id, $dist_passwd, $newdomain['domain'], $upddomain ); print_r( $result ); if ( $result['retcode'] != 1 ) die( "Ca ne fonctionne pas !" ); $tid = $result['retfields']['tid']; echo "api_status() transaction $tid\n"; $result = $client->api_status( $dist_id, $dist_passwd, $tid ); print_r( $result );
Perl Example:
# Update d'un domain name print "domain_update()\n"; my %upddomain = %newdomain; $upddomain{'ns2'} = "ns0.free.org"; $upddomain{'ns3'} = "ns1.free.org"; $upddomain{'ns4'} = "ns0.proxad.net"; $upddomain{'ns5'} = "ns1.proxad.net"; $upddomain{'tech_id'} = $tech_id; $upddomain{'bill_id'} = $bill_id; $result = $client->domain_update( $dist_id, $dist_passwd, $newdomain{'domain'}, SOAP::Data->type(map => \%upddomain) ); print Data::Dumper->Dump([$result->result]); if ($result->result->{'retcode'} !=1) { die "Ca ne fonctionne pas !\n"; }; $tid = $result->result->{'retval'};
Prototype:
function domain_delete( $dist_id, $dist_passwd, $domain )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | |
| -1 | -3 | There’s allready a delete command in process for this domain name |
| -1 | -4 | Domain name undefined |
| 0 | 0 | Domain name doesn’t exist in our database |
| 1 | TID | (OK check ‘tid’ transaction ID used by api_status() ) |
PHP Example:
/* Delete d'un domain name ---------------------------------------- */ echo "domain_delete() \n"; $result = $client->domain_delete( $dist_id, $dist_passwd, $newdomain['domain'] ); print_r( $result ); if ( $result['retcode'] == 1 ) { $tid = $result['retfields']['tid']; echo "api_status() transaction $tid\n"; $result = $client->api_status( $dist_id, $dist_passwd, $tid ); print_r( $result ); }
Perl Example:
# Delete d'un domain name print "domain_delete()\n"; $result = $client->domain_delete( $dist_id, $dist_passwd, $newdomain{'domain'} ); print Data::Dumper->Dump([$result->result]); if ($result->result->{'retcode'} !=1) { die "Ca ne fonctionne pas !\n"; }; $tid = $result->result->{'retval'};
Prototype:
function domain_info( $dist_id, $dist_passwd, $domain )
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | $dist_id is not Owner/Admin/Tech/Bill contact (permission denied) |
| -1 | -3 | Domain name undefined |
| 0 | 0 | Domain name doesn’t exist in our database |
| 1 | ID | (OK, ID = domain_id + array retfields[]) |
[retcode] => 1 [retval] => 141958 [retfields] => Array ( [id] => 141958 [lastupdate] => 2006-09-26 21:43:10 [lastupdate_ip] => 88.191.249.162 [domain] => demo-now-1159299779.com [registrar_creation] => 2006-09-26 21:43:10 [registrar_expiration] => 2010-09-26 21:43:10 [authinfo] => hqruzKPTYZ13 [service] => dns [ip_dns_master] => [status] => Active [registry_status] => 64 [ns0] => ns0.free.org [ns1] => ns1.free.org [ns2] => ns3.free.org [bill_id] => 127743 [tech_id] => 127743 [admin_id] => 13490 [owner_id] => 151049 )
PHP Example:
/* Information a propos d'un domain name -------------------------- */ echo "domain_info()\n"; $result = $client->domain_info( $dist_id, $dist_passwd, $newdomain['domain'] ); print_r( $result );
Perl Example:
# Information a propos d'un domain name print "domain_info()\n"; $result = $client->domain_info( $dist_id, $dist_passwd, $newdomain{'domain'} ); print Data::Dumper->Dump([$result->result->{'retfields'}]);
Prototype
function domain_list( $dist_id, $dist_passwd, $role )
If $role is empty it’s default value is “Owner Admin Tech Bill” (all domain names where $dist_id is owner/admin/tech/bill contact) you can limit the list to one or several type of contact.
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
Return array with domain name and registry expiration date from unix timestamp.
PHP Example:
/* Liste des domaines (et date d'expiration) dont le reseller ------- */ /* $dist_id est l'un des contacts (Owner/Admin/Tech/Bill) ------------ */ echo "domain_list() contact $dist_id\n"; $result = $client->domain_list( $dist_id, $dist_passwd ); print_r( $result );
Perl Example:
# Liste des domaines (et date d'expiration) dont le reseller # $dist_id est l'un des contacts (Owner/Admin/Tech/Bill) print "domain_list() contact $dist_id\n"; $result = $client->domain_list( $dist_id, $dist_passwd ); print Data::Dumper->Dump([$result->result->{'retfields'}]);
Prototype:
function domain_transfer( $dist_id, $dist_passwd, $domain, $authkey, $extid )
$extid is a contact_id, it’s only used in case of .FR transfert, it’s useless for other TLDs.
Return values:
| retcode | retval | Comment |
|---|---|---|
| -1 | -1 | $dist_id or $dist_passwd invalid |
| -1 | -2 | Domain name status is Pending... |
| -1 | -3 | Domain name locked (locker/transfer/update prohibited) |
| -1 | -4 | Whois parsing error |
| -1 | -5 | login_id error |
| -1 | -6 | acces denied |
| -1 | -7 | TLD not managed by API |
| -1 | -8 | Domain name created less than 2 month ago |
| -1 | -9 | Undefined authkey |
| -1 | -10 | $extid is undefined in case it’s can’t be omited |
| 1 | TID | (check ‘tid’ and ‘owner_id’) |
In case of transfert failure (invalide authkey, no vote reply, invalid email in whois, etc.) it’s possible to restart the transfert with ‘domain_transfer()’ command. This operation will not be billed.
WARNING: for gTLD (.COM .NET .ORG .BIZ .INFO .NAME .US) domain_transfer() send an e-mail to require a transfer validation to owner/admin contact email available in whois database. This e-mail is sent with From: and URL: provided at API registration by reseller.
PHP Example:
/* Transfert d'un domain name ------------------------------------- */ /* ATTENTION: pour les gTLD envoi un e-mail de demande d'acceptation */ /* du transfert au titulaire et admin contact du domain name */ $domain = "un-de-mes-domaines.com"; $authkey = "1234secret5678"; $result = $client->domain_transfer( $dist_id, $dist_passwd, $domain, $authkey ); print_r( $result ); /* relance un transfert */ $authkey = "NewSecret5678"; $result = $client->domain_transfer( $dist_