SMSWay vous offre la possibilité d'envoyer directement des SMS depuis votre site Web, application mobile ou tout autre support relié à l'Internet. L'API SMSWay permet d'envoyer un SMS à n'importe quel contact depuis votre site Web, mobile, etc.

Pour pouvoir utiliser cette application vous devez :
- Disposer de crédits SMSWay où, à défaut, recharger votre compte
- Prendre connaissance de votre api-key disponible ci-dessous
- Implémenter l'API en language sur votre plateforme.


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($sessionCURLOPT_URL,$url); 
curl_setopt($sessionCURLOPT_RETURNTRANSFER,true); 
curl_setopt($sessionCURLOPT_POSTfalse); 
curl_setopt($sessionCURLOPT_HEADERfalse); 
curl_setopt($sessionCURLOPT_TIMEOUT,120); 
curl_setopt ($sessionCURLOPT_FRESH_CONNECTtrue); 
curl_setopt ($sessionCURLOPT_SSL_VERIFYPEER,false); 
curl_setopt ($sessionCURLOPT_SSL_VERIFYHOST,false); 
$response curl_exec($session); 
curl_close($session); 

// result 
if ($response=="sended"
    echo 
"SMS ok"
else 
    echo 
$response;
?>


Callback example (PHP) :
<?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


< Retour C'est parti ! >