# API: Get domain contacts
# domainGetContacts
Get domain contact details
# Required parameters
Parameter | Description |
---|---|
id | Domain ID |
# Request
GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=domainGetContacts&id=ID
# PHP Samples
$url = 'http://url_to_hb.com/admin/api.php';
$post = [
'call' => 'domainGetContacts',
'api_id' => $API_ID,
'api_key' => $API_KEY,
'id' => $ID,
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
curl_close($ch);
$return = json_decode($data, true);
print_r($return);
include 'class.hbwrapper.php';
HBWrapper::setAPI('http://url_to_hb.com/admin/api.php','API ID','API Key');
$params = [
'id' => $ID,
];
$return = HBWrapper::singleton()->domainGetContacts($params);
print_r($return);
/* Use this method to access HostBill api from HostBill modules */
$api = new ApiWrapper();
$params = [
'id' => $ID,
];
$return = $api->domainGetContacts($params);
print_r($return);
# Response
{
"success": true,
"ContactInfo": {
"registrant": {
"firstname": "John",
"lastname": "Doe",
"companyname": "",
"address1": "4105 Davis Street",
"address2": "",
"city": "Athens",
"state": "Georgia",
"country": "US",
"postcode": "30601",
"email": "john@doe.com",
"phonenumber": "+1.111111111"
},
"tech": {
"firstname": "John",
"lastname": "Doe",
"companyname": "",
"address1": "4105 Davis Street",
"address2": "",
"city": "Athens",
"state": "Georgia",
"country": "US",
"postcode": "30601",
"email": "john@doe.com",
"phonenumber": "+1.111111111"
},
"admin": {
"firstname": "John",
"lastname": "Doe",
"companyname": "",
"address1": "4105 Davis Street",
"address2": "",
"city": "Athens",
"state": "Georgia",
"country": "US",
"postcode": "30601",
"email": "john@doe.com",
"phonenumber": "+1.111111111"
},
"billing": {
"firstname": "John",
"lastname": "Doe",
"companyname": "",
"address1": "4105 Davis Street",
"address2": "",
"city": "Athens",
"state": "Georgia",
"country": "US",
"postcode": "30601",
"email": "john@doe.com",
"phonenumber": "+1.111111111"
}
},
"call": "domainGetContacts",
"server_time": 1703159888
}