# API: Send Mobile Notify to Client
# sendMobileClientNotify
Send mobile notification to customer. Notifications needs to be enabled in Extras->Mobile Notifications. Notifications needs to be enabled in Extras->Mobile Notifications
# Required parameters
Parameter | Description |
---|---|
client_id | HostBill client ID |
subject | Message subject |
body | Message body |
# Optional parameters
Parameter | Description |
---|---|
server_id | Connection ID to send SMS from |
# Request
GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=sendMobileClientNotify&client_id=CLIENT_ID&subject=SUBJECT&body=BODY
# PHP Samples
$url = 'http://url_to_hb.com/admin/api.php';
$post = [
'call' => 'sendMobileClientNotify',
'api_id' => $API_ID,
'api_key' => $API_KEY,
'client_id' => $CLIENT_ID,
'subject' => $SUBJECT,
'body' => $BODY,
];
$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 = [
'client_id' => $CLIENT_ID,
'subject' => $SUBJECT,
'body' => $BODY,
];
$return = HBWrapper::singleton()->sendMobileClientNotify($params);
print_r($return);
/* Use this method to access HostBill api from HostBill modules */
$api = new ApiWrapper();
$params = [
'client_id' => $CLIENT_ID,
'subject' => $SUBJECT,
'body' => $BODY,
];
$return = $api->sendMobileClientNotify($params);
print_r($return);
# Response
{
"success": true,
"call": "sendMobileClientNotify",
"server_time": 1460986731
}