Deskripsi
Membuat host (child nameserver) untuk domain yang sudah dibuat.
Query
host/addchild
List Variabel
| Nama | Tipe Data | Required/Optional | Deksripsi |
|---|---|---|---|
| domain | String(63) | Required | Nama domain |
| api_id | Integer(11) | Required | Nilai yang merelasikan api dengan domain |
| nameserver | String(63) | Required | Nama host yang akan dibuat berdasarkan parameter domain (contoh : ns1.namadomain.co.id) |
| ipaddress | IPV4 | Required | IP Address (IPV4) yang akan diasosiasikan dengan domain |
Contoh
$post["username"] = 'apiusername';
$post["password"] = hash('sha256','apipassword');
$post["domain"] = 'domainid.co.id'
$post["nameserver"] = 'ns1.domainid.co.id'
$post["api_id"] = 1;
$post["ipaddress"] = '111.111.111.111'
$url = 'http://[reseller url]/api/host/addchild';
$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);
Respon Contoh
Berhasil
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><epp><result><resultCode>1000</resultCode><resultMsg>Command completed successfully</resultMsg></result></epp>
Gagal
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><epp><result><resultCode>2303</resultCode><resultMsg>Object does not exist; parent domain does not exist</resultMsg></result></epp>