<?php 

$url = 'https://app.bongasms.co.ke/api/send-sms-v1';

$apiClientID = 386; // Client ID
$key = 'KkPeLm6jRGPBrzt'; // API Key
$secret = 'lptyWLR5RGdqWNBo0a5D0YllQ74ksd'; // Secret
$txtMessage = 'This is a test.';
$MSISDN = '254723411943'; //Phone Number
$serviceID = 4879; //Service ID Herer

$post_data="apiClientID=".$apiClientID."&key=".$key."&secret=".$secret."&txtMessage=".$txtMessage."&MSISDN=".$MSISDN."&serviceID=".$serviceID;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);

$result = json_decode($result);

print_r($result);

?>