Create Contact

Description

Create new contact data.

Query

contact/create

List Variable

Name Data Type Required/Optional Description
userid String(32) Required User ID
fname String(32) Required First name
lname String(32) Optional Last name
email String(63) Required Contact email
company String(32) Required Company name, use "personal" for personal account
address String(255) Required Address
address2 String(255) Optional Address 2
address3 String(255) Optional Address 3
city String(32) Required City name
province String(32) Required Province/State
phone-cc String(14) Optional Country code without "+"
phone String(14) Required Phone number without "+"
fax-cc String(14) Optional Country code without "+"
fax String(14) Optional Fax number, including country code, without "+"
country String(3) Required Country code, ie : ID, MY, SG, AU
postal_code String(8) Required Zip code

Return

Name Type
domainid String[0-9]{4-16}

Example


$post["username"] = 'apiusername';
$post["password"] = hash('sha256','apipassword');
$post["userid"] = '34'
$post["fname"] = 'Nemo'
$post["lname"] = 'Nemo'
$post["email"] = 'nemo@domain.co.id'
$post["company"] = 'personal'
$post["address"] = 'Sesame street no. 33'
$post["city"] = 'Sleman'
$post["province"] = 'DIY'
$post["phone"] = '6243434'
$post["fax"] = '6243434'
$post["country"] = 'ID'
$post["postal_code"] = '54321'
$url = 'http://[reseller url ]/api/contact/create';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiurl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
$response = curl_exec($ch);
curl_close($ch);

Example Response

Succeed:

<?xml version="1.0" encoding="UTF-8"?>
<epp>
  <result>
    <resultCode>1000</resultCode>
    <resultMsg>Command Complete Successfully</resultMsg>
  </result>
  <resultData>
    <nickhandle>01206gp3</nickhandle>
    <contactid>20</contactid>
  </resultData>
</epp>

Failed:

<?xml version="1.0" encoding="UTF-8"?>
<epp>
<result>
<resultCode>1001</resultCode>
<resultMsg>Respon Failed</resultMsg>
</result>
</epp>