Gandi Wiki


Questions

Contact methods

contact_create

Signature

string contact_create(string session, string class, string firstname, string lastname, string address, string zipcode, string city, string country, string phone, string email [, struct params])

Description

Create a Gandi contact of a given type. See glossary, Account.

Parameters

  • string session: the session id (returned by login)
  • string class: the contact class. Valid values include:
    • individual: an individual
    • company: a company
    • public: a public body
    • association: an association
  • string firstname: the firstname of the contact
  • string lastname: the lastname of the contact
  • string address: the address
  • string zipcode: the zip code
  • string city: the city
  • string country: the country (ISO 3166-1 alpha-2 code)
  • string phone: the phone number of the owner (international format)
  • string email: the e-mail of the owner

Optional and additional parameters

struct params: a struct that may contain some of the following fields:

  • General parameters
    • boolean antispam: should the e-mail of the owner be hidden from the public Whois database.
      • True: Default. Hide the owner's e-mail.
      • False: Do not hide the owner's e-mail.
    • boolean whois_obfuscated: should the informations of the owner be hidden from the public Whois database.
      • True: Default. Hide the owner's informations.
      • False: Do not hide the owner's informations.
    • boolean resell: Our contract with ICANN requires that we sell our WHOIS database to any party that requests it. However, this contact may refuse.
      • False: Default. Do not resell this contact's personal data.
      • True: Resell this contact's personal data to any party that requests it.
    • string state: the state code if needed
    • string fax: the fax phone number (international format)
    • string cellphone: the cell phone number (international format)
    • string lang: the preferred language. Possible values are "fr" (default) or "en"
  • Individual additional parameters
    • dateTime.iso8601 birth_date: the birth date
    • string birth_place: the place of birth
    • string birth_country: the country of birth (ISO 3166-1 alpha-2 code)
    • string birth_dpt: the number of the French Department of the contact's birth
    • string id_card_number: the national identity card / passport number of the contact for .IT and .SE.
    • string asia_ident_number: the national identity card / passport number of the contact for .ASIA.
  • Public body additional parameters
    • string body_name: the public body name
    • string insee_siren: the INSEE or SIREN number
    • string trademark_number: INPI or OMPI number
    • string tva: the intercommunal TVA registration number
    • string id_card_number: the VAT number of the contact for .IT and .SE.
    • string asia_ident_number: the national identity card / passport number of the contact for .ASIA.
  • Association additional parameters
    • string association_name: the association name
    • string insee_siren: the INSEE or SIREN number
    • string trademark_number: INPI or OMPI number
    • string tva: the intercommunal TVA registration number
    • dateTime.iso8601 jo_publicationdate: publication date in the Journal Officiel.
    • int jo_page: the page number of the announce in the Journal Officiel
    • dateTime.iso8601 jo_declarationdate: the date this association was declared at the Journal Officiel.
    • int jo_announcenumber: the announce number at the Journal Officiel.
    • string id_card_number: the VAT number of the contact for .IT and .SE.
    • string asia_ident_number: the national identity card / passport number of the contact for .ASIA.
  • Company additional parameters
    • string company_name: the company name
    • string insee_siren: the INSEE or SIREN number
    • string trademark_number: INPI or OMPI number
    • string tva: the intercommunal TVA registration number
    • string id_card_number: the VAT number of the contact for .IT and .SE.
    • string asia_ident_number: the national identity card / passport number of the contact for .ASIA.

Returns

The XML-RPC response will return the Gandi handle (string) of the contact created or a fault describing the problem. Possible faults are described in section Error Codes Format.

Sample code

  • Python - a contact creation for an individual who wants to register a .fr
cclass  = "individual"
firstname  = "Sophie"
lastname  = "Gandi"
address  = "15 place de la Nation"
 
zipcode  = "75011"
city  = "Paris"
country  = "FR"
phone  = "+33.102030405"
email  = "sophie@example.com"
params  = {}
params['birth_date']  = xmlrpclib.DateTime("1981-10-06")
params['birth_place']  = "Versailles"
 
params['birth_dpt']  = "78"
params['birth_country']  = "FR"
try:
    handle  = proxy.contact_create(session, cclass, firstname, lastname, address, zipcode, city, country, phone, email, params)
    print "created contact: %s" % handle
except xmlrpclib.Fault, e:
    print "could not create contact because: %d" % (e.faultString)
  • Php - a contact creation for an individual who wants to register a .fr
$class  = new xmlrpcval("individual");
$firstname  = new xmlrpcval("Sophie");
$lastname  = new xmlrpcval("Gandi");
$address  = new xmlrpcval("15 place de la Nation");
$zipcode  = new xmlrpcval("75011");
$city  = new xmlrpcval("Paris");
$country  = new xmlrpcval("FR");
$phone  = new xmlrpcval("+33.102030405", "string");
$email  = new xmlrpcval("sophie@example.com");
$params["birth_date"]  = new xmlrpcval("19811006T00:00:00", "dateTime.iso8601");
$params["birth_place"]  = new xmlrpcval("Versailles");
$params["birth_dpt"]  = new xmlrpcval("78", "string");
$params["birth_country"]  = new xmlrpcval("FR");
$params  = php_xmlrpc_encode($params);
 
$msg  = new xmlrpcmsg("contact_create", array($session, $class, $firstname, $lastname, $address, $zipcode, $city, $country, $phone, $email, $params));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not create contact because: %s\n", $reply->faultString());
}  
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("created contact: %s\n", $val);
}
  • Perl - a contact creation for an individual who wants to register a .fr
my $class  = "individual";
my $firstname  = "Sophie";
my $lastname  = "Gandi";
my $address  = "15 place de la Nation";
my $zipcode  = "75011";
my $city  = "Paris";
my $country  = "FR";
my $phone  = "+33.102030405";
my $email  = "sophie\@example.com";
my $params  = {};
$params["birth_date"]  = XMLRPC::Data->type('datetime')->value('19811006T00:00:00');
$params["birth_place"]  = "Versailles";
$params["birth_dpt"]  = "78";
$params["birth_country"]  = "FR";
my $reply  = $proxy->call("contact_create", $session, $class, $firstname, $lastname, $address, $zipcode, $city, $country, $phone, $email, $params);
my $handle  = $reply->result();
unless (defined $handle) {
    printf "could not create contact because: %s\n", $reply->faultstring;
}
else {
    printf "created contact: %s\n", $handle;
}
  • Python - a contact creation for a company that wants to register a .com
cclass  = "company"
firstname  = "Marc"
lastname  = "Reseau"
 
address  = "38 rue des hirondelles"
zipcode  = "75012"
city  = "Paris"
country  = "FR"
phone  = "+33.504030201"
email  = "marc@example.org"
 
params  = {}
params['company_name']  = "Example Inc."
params['insee_siren']  = "48327119900024"
params['trademark_number']  = "385070345"
params['tva']  = "FR3744103456"
try:
    handle  = proxy.contact_create(session, cclass, firstname, lastname, address, zipcode, city, country, phone, email, params)
    print "created contact: %s" % handle
except xmlrpclib.Fault, e:
    print "could not create contact because: %s" % e.faultString
  • Php - a contact creation for a company that wants to register a .com
$class  = new xmlrpcval("company");
$firstname  = new xmlrpcval("Marc");
$lastname  = new xmlrpcval("Reseau");
$address  = new xmlrpcval("38 rue des hirondelles");
$zipcode  = new xmlrpcval("75012");
$city  = new xmlrpcval("Paris");
$country  = new xmlrpcval("FR");
$phone  = new xmlrpcval("+33.504030201", "string");
$email  = new xmlrpcval("marc@example.org");
 
$params  = php_xmlrpc_encode(array(
    "company_name"  => "Example Inc.",
    "insee_siren"  => "48327119900024",
    "trademark_number"  => "385070345",
    "tva"  => "FR3744103456"
    )
);
 
$msg  = new xmlrpcmsg("contact_create", array($session, $class, $firstname, $lastname, $address, $zipcode, $city, $country, $phone, $email, $params));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not create contact because: %s\n", $reply->faultString());
}  
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("created contact: %s\n", $val);
}
  • Perl - a contact creation for a company that wants to register a .com
my $class  = "company";
my $firstname  = "Marc";
my $lastname  = "Reseau";
my $address  = "38 rue des hirondelles";
my $zipcode  = "75012";
my $city  = "Paris";
my $country  = "FR";
my $phone  = "+33.504030201";
my $email  = "marc\@example.org";
my $params  = {};
$params["company_name"]  = "Example Inc.";
$params["insee_siren"]  = "48327119900024";
$params["trademark_number"]  = "385070345";
$params["tva"]  = "FR3744103456";
my $reply  = $proxy->call("contact_create", $session, $class, $firstname, $lastname, $address, $zipcode, $city, $country, $phone, $email, $params);
my $handle  = $reply->result();
unless (defined $handle) {
    printf "could not create contact because: %s\n", $reply->faultstring;
}
else {
    printf "created contact: %s\n", $handle;
}



contact_update

Signature

int contact_update(string session, string handle, struct params)

Description

Update a Gandi contact.

Parameters

  • string session: the session id (returned by login)
  • string handle: the Gandi contact handle to modify
  • struct params: a struct that contains the fields to modify. All the fields may be modified, except:
    • firstname
    • lastname
    • class
    • company_name
    • association_name
    • body_name

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)
handle  = "AA1234-GANDI"
params  = {}
params['address']  = "123 rue des alouettes"
params['city']  = "Versailles"
params['zipcode']  = "78000"
try:
    opid  = proxy.contact_update(session, handle, params)
    print "update of contact '%s' is Gandi operation #%d" % (handle, opid)
except xmlrpclib.Fault, e:
    print "could not update contact '%s' because: %s" % handle, e.faultString
  • Sample code (php)
$handle  = "AA1234-GANDI";
$params  = php_xmlrpc_encode(array(
    "address"  => "123 rue des alouettes",
    "city"  => "Versailles",
    "zipcode"  => "78000",
    )
);
$msg  = new xmlrpcmsg("contact_update", array($session, new xmlrpcval($handle), $params));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not update contact '%s' because: %s\n", $handle, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("update of contact '%s' is Gandi operation: #%d\n", $handle, $val);
}
  • Sample code (perl)
my $handle  = "AA1234-GANDI";
my $params  = {};
$params["address"]  = "123 rue des alouettes";
$params["city"]  = "Versailles";
$params["zipcode"]  = "78000";
my $reply  = $proxy->call("contact_update", $session, $handle, $params);
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not update contact '%s' because: %s\n", $opid, $reply->faultstring;
}
else {
    printf "update of contact '%s' is Gandi operation #%d\n", $handle, $opid;
}



contact_del

Signature

int contact_del(string session, string handle)

Description

Delete a Gandi contact.

Parameters

  • string session: the session id (returned by login)
  • string handle: the Gandi contact handle 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 (python)
handle  = "AA1234-GANDI"
try:
    opid  = proxy.contact_del(session, handle)
    print "deletion of contact '%s' is Gandi operation #%d" % (handle, opid)
except xmlrpclib.Fault, e:
    print "could not delete contact '%s' because: %s" % (handle, e.faultString)
  • Sample code (php)
$handle  = "AA1234-GANDI";
$msg  = new xmlrpcmsg("contact_del", array($session, new xmlrpcval($handle)));
$reply  = $proxy->send($msg);
if ($reply->faultCode()) {
    printf("could not delete contact '%s' because: %s\n", $handle, $reply->faultString());
}
else {
    $val  = $reply->value();
    $val  = $val->scalarval();
    printf("deletion of contact '%s' is Gandi operation: #%d\n", $handle, $val);
}
  • Sample code (perl)
my $handle  = "AA1234-GANDI";
my $reply  = $proxy->call("contact_del", $session, $handle);
my $opid  = $reply->result();
unless (defined $opid) {
    printf "could not update contact '%s' because: %s\n", $opid, $reply->faultstring;
}
else {
    printf "deletion of contact '%s' is Gandi operation #%d\n", $handle, $opid;
}



contact_info

Signature

struct contact_info(string session, string handle)

Description

Retrieve a Gandi contact informations.

Parameters

  • string session: the session id (returned by login)
  • string handle: the Gandi contact handle

Returns

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

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

Questions

Flux RSS des questions correspondant à ce filtre (Aide)

Dernière modification: le 22/06/2011 à 17:02 par Romuald B. (Gandi)