In my controller i have
public function msgStatus(){
$this->load->library('clickatell_rest');
$this->clickatell_rest->getMsgStatus();
}
clickatell rest library class
public function getMsgStatus(){
$msgId = "message ID here";
$authToken = urlencode("token here");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.clickatell.com/rest/message/$msgId");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"X-Version: 1",
"Accept: application/json",
"Authorization: Bearer $authToken"
));
$result = curl_exec ($ch);
print_r($result); exit();
return $result;
}`
when i execute the code the following error displays though my credentials are correct
{"error":{"code":"001","description":"Authentication failed","documentation":"http://www.clickatell.com/help/apidocs/error/001.htm"}}
i expect my code to return a message status (i.e if the message is queued, failed,delivered to recepient, etc)