API:getClientDetails - Get client details
Get client details
Required parameters
- id
- Client ID
Request
GET http://url_to_your_hostbill.com/admin/api.php?api_id=API_ID&api_key=API_KEY&call=getClientDetails&id=ID
<?php
include 'class.hbwrapper.php';
HBWrapper::setAPI('http://url_to_hb.com/admin/api.php','API ID','API Key');
$params = array(
'id'=>ID
);
$return = HBWrapper::singleton()->getClientDetails($params);
print_r($return);
?>
<?php
$url = 'http://url_to_hb.com/admin/api.php';
$post = array(
'api_id' => API_ID,
'api_key' => API_Key,
'call' => 'getClientDetails',
'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, $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);
?>
<?php
/* Use this method to access HostBill api from HostBill modules */
$api = new ApiWrapper();
$params = array(
'id'=>ID
);
$return = $api->getClientDetails($params);
print_r($return);
?>
Response
{
"success": true,
"client": {
"id": "1",
"email": "[email protected]",
"password": "474bf122c92de249ace867a003cb7196",
"lastlogin": "2011-11-25 04:32:40",
"ip": "213.54.21.3",
"host": "cmt-random.uk",
"status": "Active",
"parent_id": "0",
"firstname": "John",
"lastname": "Doe",
"companyname": "",
"address1": "Address 54",
"address2": "",
"city": "Soullans",
"state": "Birmingham",
"postcode": "B33 8TH",
"country": "GB",
"phonenumber": "357755733",
"datecreated": "2011-09-24",
"notes": "",
"language": "spanish",
"company": "0",
"credit": "0.00",
"taxexempt": "0",
"latefeeoveride": "0",
"cardtype": "Visa",
"cardnum": null,
"expdate": null,
"overideduenotices": "0",
"client_id": "1",
"currency_id": "0",
"countryname": "United Kingdom"
},
"call": "getClientDetails",
"server_time": 1323442995
}