SMS Sample Scripts


These quickstarts are short, simple guides intended to help you get started using InMobile’s SMS APIs.

PHP Script

<?php
//HTTP username.
$username = urlencode('systemusername'); $password = urlencode('APIKey');
?>
$destination = array("MobileNumber"); $source= "SenderID";
$msg="Message timess";
$dataArray = array(
    'source' => $source,
    'destination'=> $destination,
    'text' => $msg
);
$api_url = 'https://cp.inmobilews.com/API/SendBulkSMS'; $data = json_encode($dataArray);
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_URL, $api_url); curl_setopt($ch, CURLOPT_TIMEOUT, 80);
curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data),
'Authorization: Basic '. base64_encode("$username:$password") )
);
$response = curl_exec($ch);
                      curl_close($ch);
                      echo $response;




API Specification API Parameters