# API: Get domain details

# getDomainDetails

Return domain details

# Required parameters

Parameter Description
id Domain ID

# Request

GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=getDomainDetails&id=ID

# PHP Samples

$url = 'http://url_to_hb.com/admin/api.php';
$post = [
  'call' => 'getDomainDetails',
  '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()->getDomainDetails($params);
print_r($return);
/* Use this method to access HostBill api from HostBill modules */
$api = new ApiWrapper();
$params = [
  'id' => $ID,
];
$return = $api->getDomainDetails($params);
print_r($return);

# Response

{
    "success": true,
    "details": {
        "id": "27",
        "client_id": "3",
        "order_id": "170",
        "tld_id": "64",
        "name": "myhostbillapitest.com",
        "reg_module": "17",
        "payment_module": "45",
        "date_created": "2011-10-04",
        "firstpayment": "4.00",
        "recurring_amount": "4.00",
        "period": "1",
        "expires": "2012-10-04",
        "type": "Register",
        "status": "Active",
        "next_due": "2012-10-04",
        "next_invoice": "2012-09-27",
        "idprotection": "0",
        "nameservers": [
            "",
            "",
            "",
            ""
        ],
        "autorenew": "1",
        "reglock": "0",
        "manual": "0",
        "epp_code": "",
        "notes": "",
        "extended": "",
        "synch_date": "0000-00-00 00:00:00",
        "nsips": false,
        "lastname": "Doe",
        "firstname": "John",
        "custom": false
    },
    "call": "getDomainDetails",
    "server_time": 1317712335
}
Last Updated: 10/7/2024, 2:36:43 PM