Gandi Docs

 |   AAA  |    fr   en  

Questions

Domain methods

domain_list

Signature

array domain_list(string session)

Description

Returns an array of domains for which the logged user is the reseller or a contact (owner, administrative, billing or technical).

Parameters

  • string session: the session id (returned by login)

Returns

The XML-RPC response will contain an array of domains (string) or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
import pprint
try:
    domains  = proxy.domain_list(session)
    print "domains:"
    pprint.pprint(domains)
except xmlrpclib.Fault, e:
    print "could not retrieve the list of domains because: %s" % e.faultString
  • Sample code (php)
$msg  = new xmlrpcmsg("domain_list", array($session));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not retrieve the list of domains because: %s\n", $reply->faultString()); 
}
else {  
    $val  = php_xmlrpc_decode($reply->value());
    print_r($val);
}
  • Sample code (perl)
my $reply  = $proxy->call("domain_list", $session);
my $domains  = $reply->result();
unless (defined $domains) {
    print "could not retrieve the list of domains because: " . $reply->faultstring . "\n";
}
else {
    print Dumper($domains);
}



domain_available

Signature

struct domain_available(string session, array domains)

Description

Check a domain availability.

Parameters

  • string session: the session id (returned by login)
  • array domains: the domain names array (string)

Returns

The XML-RPC response will contain the availability (struct) of the domains or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
import pprint
domains  = ["example.net", "example.org", "example.com"]
try:
    availability  = proxy.domain_available(session, domains)
    print "available domains:"
    pprint.pprint(availability)
except xmlrpclib.Fault, e:
    print "could not check for availability because: %s" % e.faultString
  • Sample code (php)
$domains  = array(
    new xmlrpcval("example.net"),
    new xmlrpcval("example.org"),
    new xmlrpcval("example.com")
);
$msg  = new xmlrpcmsg("domain_available", array($session, new xmlrpcval($domains, "array")));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not check for availability because: %s\n", $reply->faultString()); 
}
else {  
    $val  = $reply->value();
    $val->structreset();
    print "available domains:\n";
    while (list($key, $value)  = $val->structeach()) {
        printf("%s : %s\n", $key, $value->scalarval() ? "True" : "False");
    }
}
  • Sample code (perl)
my $domains  = ["example.net", "example.org", "example.com"];
my $reply  = $proxy->call("domain_available", $session, $domains);
my $availability  = $reply->result();
    unless (defined $availability) {
    print "could not check for availability because: " . $reply->faultstring . "\n";
}
else {
    while (($domain, $available)  = each (%$availability)) {
        print $domain . " : " . ($available ? "True" : "False") . "\n";
    }
}



domain_lock

Signature

int domain_lock(string session, string domain)

Description

Add a lock status (cf. domain_info) to avoid any fraudulent transfer.

Availability

Any domains except those ending with .FR, .EU or .BE.

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain name to lock

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
domain  = "example.net"
try:
    opid  = proxy.domain_lock(session, domain)
    print "locking of domain '%s' is Gandi operation #%d" % (domain, opid)
except xmlrpclib.Fault, e:
    print "could not lock domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$msg  = new xmlrpcmsg("domain_lock", array($session, new xmlrpcval($domain)));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not lock domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("locking of domain '%s' is Gandi operation #%d\n", $domain, $val);
}
  • Sample code (perl)
my $domain  = "example.net";
my $reply  = $proxy->call("domain_lock", $session, $domain);
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not lock domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    printf "locking of domain '%s' is Gandi operation #%d\n", $domain, $opid;
}



domain_unlock

Signature

int domain_unlock(string session, string domain)

Description

Remove a lock status (cf. domain_info) to transfer the domain to another registrar.

Availability

Any domains except those ending with .FR, .EU or .BE.

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain name to unlock

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem.

Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
domain  = "example.net"
try:
    opid  = proxy.domain_unlock(session, domain)
    print "unlocking of domain '%s' is Gandi operation #%d" % (domain, opid)
except xmlrpclib.Fault, e:
    print "could not unlock domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$msg  = new xmlrpcmsg("domain_unlock", array($session, new xmlrpcval($domain)));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not unlock domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("unlocking of domain '%s' is Gandi operation #%d\n", $domain, $val);
}
  • Sample code (perl)
my $domain  = "example.net";
my $reply  = $proxy->call("domain_unlock", $session, $domain);
my $opid  = $reply->result();
unless (defined $opid) {
   printf "could not unlock domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
   printf "unlocking of domain '%s' is Gandi operation #%d\n", $domain, $opid;
}



domain_info

Signature

struct domain_info(string session, string domain)

Description

Retrieve the informations linked to this domain (contacts, nameservers, redirections, weblogs…). This method only works on domains handled by Gandi.

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain name

Returns

The XML-RPC response will contain the informations (struct) associated with the specified domain or a fault describing the problem.

The returned struct contains the following keys:

  • string owner_handle: the handle of the domain owner
  • string admin_handle: the handle of the domain administrative contact
  • string tech_handle: the handle of the domain technical contact
  • string billing_handle: the handle of the domain billing contact
  • dateTime.iso8601 registry_creation_date: the creation date of the domain
  • dateTime.iso8601 registry_last_update: the date the domain was last updated
  • dateTime.iso8601 registry_expiration_date: the expiration date of the domain
  • dateTime.iso8601 registrar_creation_date: the date the domain started to be handled by Gandi
  • boolean locked: a boolean indicating whether or not this domain is locked (may be transferred, cf. Transfer).
    • True: The domain cannot be transferred. It must be unlocked first.
    • False: The domain can be transferred.
  • string authorization_code: the authorization code (used for transfers) of this domain

Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
import pprint
domain  = "example.net"
 
try:
    info  = proxy.domain_info(session, domain)
    pprint.pprint(info)
except xmlrpclib.Fault, e:
    print "could not get information for domain '%s': %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$msg  = new xmlrpcmsg("domain_info", array($session, new xmlrpcval($domain)));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not get information for domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = php_xmlrpc_decode($reply->value());
    print_r($val);
}
  • Sample code (perl)
my $domain  = "example.net";
my $reply  = $proxy->call("domain_info", $session, $domain);
my $info  = $reply->result();
unless (defined $opid) {
    printf "could not get information for domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    print Dumper($info);
}



domain_renew

Signature

int domain_renew(string session, string domain, int period)

Description

Renew a domain for a number of years.

Availability

The total number of years cannot exceed 10.

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain
  • int period: the renewal period, in years

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
domain  = "example.net"
try:
    opid  = proxy.domain_renew(session, domain, 4)
    print "renewal of '%s' is Gandi operation #%d" % (domain, opid)
except xmlrpclib.Fault, e:
    print "could not renew domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$msg  = new xmlrpcmsg("domain_renew", array($session, new xmlrpcval($domain), new xmlrpcval(4, "int")));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not renew domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("renewal of '%s' is Gandi operation #%d\n", $domain, $val);
}
  • Sample code (perl)
my $domain  = "example.net";
my $reply  = $proxy->call("domain_renew", $session, $domain, 4);
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not renew domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    printf "renewal of domain '%s' is Gandi operation #%d\n", $domain, $opid;
}



domain_create

Signature

int domain_create(string session, string domain, int period, string owner_handle, string admin_handle, string tech_handle, string billing_handle, array nameservers [, string lang])

Description

Register a domain with Gandi and associate it to a list of contacts.

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain to create
  • int period: the number of years to register the domain for
  • string owner_handle: the Gandi handle of the domain owner
  • string admin_handle: the Gandi handle of the admin contact
  • string tech_handle: the Gandi handle of the tech contact
  • string billing_handle: the Gandi handle of the billing contact
  • array nameservers: the nameservers (string) of the domain

Optional parameter

  • string lang: if the domain name you are trying to register is an IDN (Internationalized Domain Name, rfc3490) you must specify the three-letters ISO 639-2 Alpha-3 code for the language used.

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
domain  = "example.org"
period  = 1
owner_handle  = "AA1234-GANDI"
admin_handle  = "BB2345-GANDI"
tech_handle  = "CC3456-GANDI"
 
billing_handle  = "DD4567-GANDI"
ns_list  = ["ns1.example.net", "ns2.example.net", "ns1.example.com"]
try:
    opid  = proxy.domain_create(session, domain, period, owner_handle, admin_handle, tech_handle, billing_handle, ns_list)
    print "creation of domain '%s' is Gandi operation #%d" % (domain, opid)
except xmlrpclib.Fault, e:
    print "could not create domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.org";
$period  = new xmlrpcval(1, "int");
$owner_handle  = new xmlrpcval("AA1234-GANDI");
$admin_handle  = new xmlrpcval("AA1234-GANDI");
$tech_handle  = new xmlrpcval("CC3456-GANDI");
$billing_handle  = new xmlrpcval("DD4567-GANDI");
$nameservers  = php_xmlrpc_encode(array("ns1.example.net", "ns2.example.net", "ns1.example.com"));
$msg  = new xmlrpcmsg("domain_create",
    array($session, new xmlrpcval($domain),
        $period, $owner_handle,
        $admin_handle, $tech_handle,
        $billing_handle, $nameservers
    )
);
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not create domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("creation of domain '%s' is Gandi operation #%d\n", $domain, $val);
}
  • Sample code (perl)
my $domain  = "example.org";
my $period  = 1;
my $owner_handle  = "AA1234-GANDI";
my $admin_handle  = "AA1234-GANDI";
my $tech_handle  = "CC3456-GANDI";
my $billing_handle  = "DD4567-GANDI";
my $nameservers  = ["ns1.example.net", "ns2.example.net", "ns1.example.com"]
 
my $reply  = $proxy->call("domain_create", $session, $domain, $period, $owner_handle, $admin_handle, $tech_handle, $billing_handle, $nameservers);
 
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not create domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    printf "creation of domain '%s' is Gandi operation #%d\n", $domain, $opid;
}



domain_restore

Signature

int domain_restore(string session, string domain)

Description

Get a domain out of its redemption period. See glossary, Restore.

Availability

This function is available for domains in .COM, .NET, .BE or .EU.

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain to get out of redemption period

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
domain  = "example.net"
try:
    opid  = proxy.domain_restore(session, domain)
    print "restoration domain '%s' is Gandi operation #%d" % (domain, opid)
except xmlrpclib.Fault, e:
    print "could not restore domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$msg  = new xmlrpcmsg("domain_restore", array($session, new xmlrpcval($domain)));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not restore domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("restoration of '%s' is Gandi operation #%d\n", $domain, $val);
}
  • Sample code (perl)
my $domain  = "example.net";
my $reply  = $proxy->call("domain_restore", $session, $domain);
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not restore domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    printf "restoration of domain '%s' is Gandi operation #%d\n", $domain, $opid;
}



domain_del

Signature

int domain_del(string session, string domain)

Description

Delete a domain.

Availability

Note :

This function will be available in v1.10

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain to delete

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
domain  = "example.com"
try:
    opid  = proxy.domain_del(session, domain)
    print "deletion of '%s' is Gandi operation #%d" % (domain, opid)
except xmlrpclib.Fault, e:
    print "could not delete domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.com";
$msg  = new xmlrpcmsg("domain_del", array($session, new xmlrpcval($domain)));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not delete domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("deletion of '%s' is Gandi operation #%d\n", $domain, $val);
}
  • Sample code (perl)
my $domain  = "example.com";
my $reply  = $proxy->call("domain_delete", $session, $domain);
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not delete domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    printf "deletion of domain '%s' is Gandi operation #%d\n", $domain, $opid;
}



domain_transfer_in_available

Signature

boolean domain_transfer_in_available(string session, string domain)

Description

Check if a domain can be transfered from another registrar. See glossary, Transfer.

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain to transfer to Gandi

Returns

The XML-RPC response will contain this operation feasibility (boolean) or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
domain  = "example.net"
try:
    result  = proxy.domain_transfer_in_available(session, domain)
    print "could the domain '%s' be transfered to Gandi: %s" % (domain, result)
except xmlrpclib.Fault, e:
    print "could not check for the transfer feasibility of the domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$msg  = new xmlrpcmsg("domain_transfer_in_available", array($session, new xmlrpcval($domain)));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not check for the transfer feasibility of the domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("could the domain '%s' be transfered to Gandi: %s\n", $domain, $val ? "True" : "False");
}
  • Sample code (perl)
my $domain  = "example.net";
my $reply  = $proxy->call("domain_transfer_in_available", $session, $domain);
my $val  = $reply->result();
unless (defined $opid) {
    printf "could not check for the transfer feasibility of the domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    printf "could the domain '%s' be transfered to Gandi: %s\n", $domain, $val ? "True" : "False";
}



domain_transfer_in

Signature

int domain_transfer_in(string session, string domain, string owner_handle, string admin_handle, string tech_handle, string billing_handle, array nameservers [, string auth_code])

Description

Transfer (see glossary, Transfer) a domain from another registrar to Gandi, or from a Gandi account to a Gandi reseller. If the domain is already at Gandi (internal transfer), owner_handle, admin_handle, tech_handle and billing_handle are maintained.

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain to transfer to Gandi
  • string auth_code: this domain's transfer authorization code or the AFNIC titular key (if the TLD is .fr)
  • string owner_handle: the Gandi handle of the domain owner
  • string admin_handle: the Gandi handle of the domain admin contact
  • string tech_handle: the Gandi handle of the domain tech contact
  • string billing_handle: the Gandi handle of the domain billing contact
  • array nameservers: the nameservers (string) of the domain

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Sample code (python)
ns_list  = ["ns1.example.net", "ns2.example.net", "ns1.example.com"]
try:
    opid  = proxy.domain_transfer_in(session, "example.net", "AA1234-GANDI", "BB2345-GANDI", "BB2345-GANDI", "BB2345-GANDI", ns_list, "G0R7Y568B740DK27")
    print "transfer of '%s' to Gandi is Gandi operation #%d" % (domain, opid)
except xmlrpclib.Fault, e:
    print "could not transfer domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$auth_code  = new xmlrpcval("G0R7Y568B740DK27");
$owner_handle  = new xmlrpcval("AA1234-GANDI");
$admin_handle  = new xmlrpcval("BB2345-GANDI");
$tech_handle  = new xmlrpcval("BB2345-GANDI");
$billing_handle  = new xmlrpcval("BB2345-GANDI");
$nameservers  = php_xmlrpc_encode(array("ns1.example.net", "ns2.example.net", "ns1.example.com"));
$msg  = new xmlrpcmsg("domain_transfer_in", array($session, new xmlrpcval($domain), $owner_handle, $admin_handle, $tech_handle, $billing_handle, $nameserver, $auth_code));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not transfer the domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("transfer of '%s' to Gandi is Gandi operation #%d\n", $domain, $val);
}
  • Sample code (perl)
my $domain  = "example.net";
my $auth_code  = "G0R7Y568B740DK27";
my $owner_handle  = "AA1234-GANDI";
my $admin_handle  = "BB2345-GANDI";
my $tech_handle  = "BB2345-GANDI";
my $billing_handle  = "BB2345-GANDI";
my $nameservers  = ["ns1.example.net", "ns2.example.net", "ns1.example.com"]
my $reply  = $proxy->call("domain_transfer_in", $session, $domain, $owner_handle, $admin_handle, $tech_handle, $billing_handle, $nameservers, $auth_code);
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not transfer the domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    printf "transfer of domain '%s' to Gandi is Gandi operation #%d\n", $domain, $opid;
}



domain_transfer_out

Signature

boolean domain_transfer_out(string session, int opid, boolean allow)

Description

Accept or deny a transfer of a domain from Gandi to another registrar. See glossary, Transfer.

Availability

Note :

This function will be available in v1.10

Parameters

  • string session: the session id (returned by login)
  • int opid: the transfer operation id (retrieved via operation_list)
  • boolean allow: whether to allow the transfer or refuse it
    • True: Allow the transfer.
    • False: Refuse the transfer.

Returns

The XML-RPC response will contain True (boolean) or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample

  • Sample code (python)
# opid  = 1234, retrieved via operation_list
try:
    proxy.domain_transfer_out(session, opid, True)
except xmlrpclib.Fault, e:
    print "Invalid operation ID: #%d" % opid
  • Sample code (php)
# $opid  = new xmlrpcval(1234);
$ack  = new xmlrpcval(True, "boolean");
$msg  = new xmlrpcmsg("domain_transfer_out", array($session, $opid, $ack));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("Invalid operation ID: #%d\n", $opid->scalarval());
}
  • Sample code (perl)
# my $opid  = 1234;
my $reply  = $proxy->call("domain_transfer_out", $session, $opid, XMLRPC::Data->type('boolean')->value(1));
 
my $opid  = $reply->result();
unless (defined $opid) {
    printf "Invalid operation ID #%d\n", $opid;
}



domain_trade

Signature

int domain_trade(string session, string domain, string owner_handle, string admin_handle, string tech_handle, string billing_handle [, string afnic_titularkey])

Description

Start the trade of a domain from another registrar to Gandi.

Availability

Note :

This function will be available in v1.10

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain to trade to Gandi
  • string owner_handle: the Gandi handle of the domain owner to trade the domain to
  • string admin_handle: the Gandi handle of the domain admin contact
  • string tech_handle: the Gandi handle of the domain tech contact
  • string billing_handle: the Gandi handle of the domain billing contact

Optional parameter

  • string afnic_titularkey: the AFNIC titular key (if the TLD is .fr)

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.

  • Sample code (python)
try:
    opid  = proxy.trade(session, "example.net", "AA1234-GANDI", "BB2345-GANDI", "BB2345-GANDI", "BB2345-GANDI")
    print "trade of '%s' to Gandi is Gandi operation #%d" % (domain, opid)
except xmlrpclib.Fault, e:
    print "could not trade domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$owner_handle  = new xmlrpcval("AA1234-GANDI");
$admin_handle  = new xmlrpcval("BB2345-GANDI");
$tech_handle  = new xmlrpcval("BB2345-GANDI");
$billing_handle  = new xmlrpcval("BB2345-GANDI");
$msg  = new xmlrpcmsg("domain_trade", array($session, new xmlrpcval($domain), $owner_handle, $admin_handle, $tech_handle, $billing_handle));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not trade the domain '%s' because: %s\n", $domain, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("trade of '%s' to Gandi is Gandi operation #%d\n", $domain, $val);
}
  • Sample code (perl)
my $domain  = "example.net";
my $owner_handle  = "AA1234-GANDI";
my $admin_handle  = "BB2345-GANDI";
my $tech_handle  = "BB2345-GANDI";
my $billing_handle  = "BB2345-GANDI";
 
my $reply  = $proxy->call("domain_trade", $session, $domain, $owner_handle, $admin_handle, $tech_handle, $billing_handle);
 
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not trade domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    printf "trade of '%s' to Gandi is Gandi operation #%d\n", $domain, $opid;
}



domain_change_owner

Signature

int domain_change_owner(string session, string domain, string new_owner [, string new_admin, string new_tech, string new_billing])

Description

Change the owner of a domain registered with Gandi and, optionally, the admin, tech and billing contacts. See glossary, Change of Ownership.

Availability

Note :

This function will be available in v1.10

Parameters

  • string session: the session id (returned by login)
  • string new_owner: the Gandi handle of the new domain owner

Optional parameters

  • string new_admin: the Gandi handle of the new admin contact
  • string new_tech: the Gandi handle of the new tech contact
  • string new_billing: the Gandi handle of the new billing contact

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.

  • Sample code (python)
try:
    opid  = proxy.domain_change_owner(session, "example.net", "AA9876-GANDI")
print "changing owner of domain '%s' is Gandi operation #%d" % (domain, opid)
    except xmlrpclib.Fault, e:
    print "could not change the owner of domain '%s' because: %s" % (domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$owner  = new xmlrpcval("AA9876-GANDI");
$msg  = new xmlrpcmsg("domain_change_owner", array($session, new xmlrpcval($domain), $owner));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
   printf("could not change the owner of domain '%s' because: %s\n", $domain, $reply->faultString());
}  
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("changing owner of domain '%s' is Gandi operation #%d\n", $domain, $val)
}
  • Sample code (perl)
my $domain  = "example.net";
my $owner  = "AA9876-GANDI";
 
my $reply  = $proxy->call("domain_change_owner", $session, $domain, $owner);
 
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not change the owner of domain '%s' because: %s\n", $domain, $reply->faultstring;
}
else {
    printf "changing owner of domain '%s' is Gandi operation #%d\n", $domain, $opid;
}



domain_change_contact

Signature

int domain_change_contact(string session, string domain, string type, string new_contact)

Description

Change a given contact of a domain registered with Gandi.

Parameters

  • string session: the session id (returned by login)
  • string domain: the domain name
  • string type: which contact to change. Valid values include:
    • admin: the administrative contact
    • billing: the billing contact
    • tech: the technical contact
  • string new_contact: the Gandi handle of the new contact

Returns

The XML-RPC response will contain this operation attributed ID (int) or a fault describing the problem. Possible faults are described in section Error Codes Format.

  • Sample code (python)
domain  = "example.net"
type  = "billing"
handle  = "BL4444-GANDI"
try:
    opid  = proxy.domain_change_contact(session, domain, type, handle)
    print "changing %s contact of domain '%s' to '%s' is Gandi operation #%d" % (type, domain, handle, opid)
except xmlrpclib.Fault, e:
    print "could not change the %s contact of domain '%s' because: %s" % (type, domain, e.faultString)
  • Sample code (php)
$domain  = "example.net";
$type  = "billing";
$handle  = "BL4444-GANDI";
$msg  = new xmlrpcmsg("domain_change_contact", array($session, new xmlrpcval($domain), new xmlrpcval($type), new xmlrpcval($handle)));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
   printf("could not change the %s contact of domain '%s' because: %s\n", $type, $domain, $reply->faultString());
}  
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("changing %s contact of domain '%s' to '%s' is Gandi operation #%d\n", $type, $domain, $handle, $val);
}
  • Sample code (perl)
my $domain  = "example.net";
my $handle  = "BL4444-GANDI";
my $type  = "billing"
 
my $reply  = $proxy->call("domain_change_contact", $session, $domain, $type, $handle);
 
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not change the %s contact of domain '%s' because: %s\n", $type, $domain, $reply->faultstring;
}
else {
    printf "changing %s contact of domain '%s' to '%s' is Gandi operation #%d\n", $type, $domain, $handle, $opid;
}

Questions

Aucune question sur cette page et ses sous-pages.

Flux RSS des questions correspondant à ce filtre (Aide)

Dernière modification: le 04/12/2008 à 16:42 par Nicolas L. (Gandi)