Revised by
Terence Foxcroft
8e44aac
| <?php
$credentials = "YOUR_EMAIL_ADDRESS:YOUR-API-TOKEN";
$url = "https://www.zoomconnect.com/zoom/api/rest/v1/sms/send.json";
$data = new stdClass();
$data->message = 'Test message';
$data->recipientNumber = '27821234567';
$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Basic ' . base64_encode($credentials),
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
echo $result;
?>
|