# API: Get client domains

# getClientDomains

Get list of client's domains.

TIP

This API call uses pagination for results.

# Required parameters

Parameter Description
id Client ID

# Optional parameters

Parameter Description
page Which page to return
filter[name] Filter by domain name
filter[status] Filter by domain status
filter[module] Filter by domain registrar
filter[client_name] Filter by client name

# Request

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

# PHP Samples

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

# Response

{
    "success": true,
    "domains": [
        {
            "id": "10",
            "manual": "0",
            "name": "hbappreseller.co.uk",
            "lastname": "Blue",
            "firstname": "Mike",
            "cid": "6",
            "period": "2",
            "recurring_amount": "9.95",
            "currency_id": "0",
            "module": "NetEarthOne",
            "next_due": "2012-11-22",
            "expires": "0000-00-00",
            "status": "Pending",
            "type": "Register",
            "date_created": "0000-00-00",
            "autorenew": "1",
            "reglock": "0",
            "idprotection": "0"
        }
    ],
    "call": "getClientDomains",
    "server_time": 1323444637
}
Last Updated: 10/7/2024, 2:36:43 PM