I'm trying to programmatically send SMS messages in my php code using the REST api from Clickatell. I've got this code:
<?php
$message = "Test Message";
$numbers = array("1**********","1**********");
$data = json_encode(array("text"=>$message,"to"=>$numbers));
$authToken = "none of your buisness";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.clickatell.com/rest/message");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"X-Version: 1",
"Content-Type: application/json",
"Accept: application/json",
"Authorization: Bearer $authToken"
));
$result = curl_exec ($ch);
echo $result
?>
It all seems to work, because this is the result I'm getting:
{
"data": {
"message":[
{
"accepted":true,
"to":"1**********",
"apiMessageId":"e895a0e68089d76fa05f41046a186a70"
}
]
}
}
However, I haven't received the message on my device. Is this something I can debug or is it beyond me?