# API: Get estimates
# getEstimates
Get list of estimates
TIP
This API call uses pagination for results.
# Optional parameters
Parameter | Description |
---|---|
page | Which page to return |
# Request
GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=getEstimates
# PHP Samples
$url = 'http://url_to_hb.com/admin/api.php';
$post = [
'call' => 'getEstimates',
'api_id' => $API_ID,
'api_key' => $API_KEY,
];
$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 = [
];
$return = HBWrapper::singleton()->getEstimates($params);
print_r($return);
/* Use this method to access HostBill api from HostBill modules */
$api = new ApiWrapper();
$params = [
];
$return = $api->getEstimates($params);
print_r($return);
# Response
{
"success": true,
"estimates": [
{
"id": "1",
"subject": "Server maintenance [hours]",
"currency_id": "0",
"date_created": "2011-08-10",
"date_expires": "2011-08-17",
"total": "60.00",
"status": "Draft",
"firstname": "John",
"client_id": "3",
"lastname": "Doe"
}
],
"totalpages": 1,
"call": "getEstimates",
"server_time": 1317713080
}