SMSWay API for SMS Gateway Full Documentation
Single message sending (PHP) :
<?php
// config
$apiKey = "*************"; // your personal api-key
$num = "32488112233"; // destination number in international format
$content = "Hello World!"; // SMS content, 457 characters max
$from = ""; // senderID of SMS, max 11 alphanumeric characters
$hlr = "no"; // (yes/no) number verification before sending (EUR 0.01 incl. VAT)
$msgid = ""; // Optional custom value sent with SMS (ex:123)
// exec
$url = "http://api.smsway.eu/manage.php?apiKey=".urlencode($apiKey)."&content=".urlencode($content)."&num=".$num."&from=".$from."&hlr=".$hlr."&msgid=".$msgid;
$session = curl_init($url);
curl_setopt($session, CURLOPT_URL,$url);
curl_setopt($session, CURLOPT_RETURNTRANSFER,true);
curl_setopt($session, CURLOPT_POST, false);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_TIMEOUT,120);
curl_setopt ($session, CURLOPT_FRESH_CONNECT, true);
curl_setopt ($session, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt ($session, CURLOPT_SSL_VERIFYHOST,false);
$response = curl_exec($session);
curl_close($session);
// result
if ($response=="sended")
echo "SMS ok";
else
echo $response;
?>
<?php
// If SMS was sent with msgid parameter, callback will return it in variable $_GET["msgid"]
$msgid=$_GET["msgid"];
$status=$_GET["status"];
$number=$_GET["number"];
$timereceived=$_GET["timereceived"];
$cost=$_GET["cost"];
if($_GET["msgid"] && $_GET["status"] )
{
mysql_query("UPDATE sms
SET sms_status = '".$status."', sms_cost = '".$cost."'
WHERE sms_id = '".$msgid."'
LIMIT 1");
echo "OK";
}
?>
SMSWay API for SMS Gateway Full Documentation