https://www.hajanaone.com/api/sendsms.php
Perameter | Required | Description |
---|---|---|
apikey | Yes | User API Key Get from your account Dashboard |
phone | Yes | Recipient's Mobile number |
sender | Yes | Registered Mask Name (Sender ID) |
message | yes | Text Message content |
operator | NO | Enter Operator ID if your number is ported to other Network Telenor : 1, Jazz = 2, Zong = 3 , Warid = 4, Ufone = 5 |
https://www.hajanaone.com/api/sendsms.php?apikey=************&phone=923001234567&sender=SmartSMS&message=Test+SMS&operator=1
<?php
$api = 'AbCdEfGhIJkLmNoPqRsTuVwXyZ'; // Hajana One account API
$number = 923001234567; // Mobile Number
$mask = 'SmartSMS'; // Registered Mask Name
$text = 'This is Test SMS'; // Message Content
$oper = 1; // If Number is Ported to telenor
$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.';
}
?>
Developed by : Hajana One