Base URL : https://www.hajanaone.com/api/sendsms.php
Perameter |
Required |
Description |
apikey |
Yes |
User API Key Get from your account Dashboard |
phone |
Yes |
Camma Seperated Recipient's Mobile numbers, Maximum as URL support. |
sender |
Yes |
Registered Mask Name (Sender ID) |
message |
yes |
Text Message content |
Complete URL Sample : https://www.hajanaone.com/api/sendsms.php?apikey=************&phone=923001234567,923211234567,923451234567$sender=SmartSMS&message=Test+SMS
PHP Code Sample :
<?php
$api = 'AbCdEfGhIJkLmNoPqRsTuVwXyZ'; // Hajana One account API
$number = '923001234567,923211234567,923451234567'; // Comma Seperated Mobile Numbers
$mask = 'SmartSMS'; // Registered Mask Name
$text = 'This is Test SMS'; // Message Content
$url = 'https://www.hajanaone.com/api/sendsms.php?apikey='.$api.'&phone='.$number.'$sender='.urlencode($mask).'&message='.urlencode($text).'&operator='.$oper;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$result = curl_exec ($ch);
if (preg_match( "/successfully/", $result )){
echo 'SMS successfully Sent.';
}else{
echo 'SMS Sending Failed.';
}
?>