I'm using Plivo PHP library to send sms via plivo.
I'm setting the correct auth credentials in the library and it is base64 encoded as per the library in curl_request method.
I think the headers are correct and My integration with my platform works fine but when trying the send a simple message with send_message method, I cannot have it working and always get a response status 401 which is, as per the documentation, an error of authentication.
What Am I doing wrong ?
Many Thanks
My code:
//Load library messages
$this->load->library( 'Plivo' );
$p = new RestAPI( 'MANXXXXXXXXXXXXXZIWOD', 'MmXXXXXXXXXXXXXXXXXXXXXXXXXXXX' );
// //for each phone Numbers generate password associated to event
foreach ( $nums as $key => $num ) {
//For each combo send Message
$params = array(
'src' => '13307782635', // Sender's phone number with country code (US)
'dst' => '447598XXXXXX', // Receiver's phone number with country code (UK)
'text' => 'Hi, Message from your fired', // Your SMS text message
'url' => site_url( 'eventPromotion/report' ), // The URL to which with the status of the message is sent
'method' => 'POST' // The method used to call the url
);
// Send message
$response = $p->send_message($params);
// Print the response
echo "Response : ";
var_dump( $response );