Rate this article :
5/5 | 1 opinion
This article was useful to you ?
Yes
No
Vous avez noté 0 étoile(s)
Sommaire
Procédure
API stands for "Application Programming Interface". It is a set of means used by a software application and/or platform to provide access to some of its functionality.
Nowadays, APIs are widely used on the internet, particularly by service or data providers, such as the SMS service.
Thanks to APIs, you can use your own script to send an SMS instantly or at a later time.
Send an SMS using a simple call:
To send an SMS quickly and easily, simply send an HTTPS request with its parameters to the following address:
https://sms.lws.fr/sms/api?action=send-sms&api_key=SMS_API_KEY=&to=DESTINATAIRE&from=SenderID&sms=VOTRE_MESSAGE
The data to be replaced is as follows:
Using the PHP API:
You can send an SMS using a PHP API:
<?php /* Prepare the variables */ /* API Url */ $gateway_url = "https://sms.lws.fr/sms/api"; /* Action called via the API */ $action = "send-sms"; /* API key */ $apiKey = "Your API key"; /* Number to which the SMS will be sent * International format - example 33600000000 */ $to = "33600000000"; /* SenderID that will be displayed on the mobile phone. */ $senderID = "Your SenderID"; /* Encodes the SMS version of the message that will be sent */ $message = urlencode("This is a test message"); // Prepare the array of data for the API request $data = array('action' => $action, 'api_key' => $apiKey, 'to' => $to, 'from' => $senderID, 'sms' => $message, ); // Send the API request via cURL $ch = curl_init($gateway_url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $get_data = json_decode($response, true); /* The return is processed. * get_data['code'] retrieves a code according to the success or error of the API * get_data['Message'] retrieves the message Success or explanation of the error. */ if($get_data['code'] === 'ok'){ echo 'The SMS was sent successfully'; } else { echo 'Error code : '.$get_data['code'].' -- '.$get_data['message']; } ?>
Possible error codes :
100: Problem with the operator;
103 : Invalid telephone number;
105 : Use of a prohibited word;
106 : SenderID invalid or not validated;
107 : SMS typing problem;
112: Number blacklisted or API not available;
Send an SMS using a simple call:
https://sms.lws.fr/sms/api?action=send-sms&api_key=SMS_API_KEY=&to=DESTINATAIRE&from=SenderID&sms=VOTRE_MESSAGE&schedule=DATE_HEURE
You can now create your own API using the LWS SMS platform. You can use an API to send an SMS instantly or at a later time. The API will also allow you to see how much credit is left on your account.
Don't hesitate to share your comments and questions!
Rate this article :
5/5 | 1 opinion
This article was useful to you ?
Yes
No
Bonjour,
Merci de votre retour.
Actuellement notre plateforme SMS, ne permet seulement d'envoyer des messages, les réponses à vos SMS ne seront pas récupérer et donc vous ne pourrez pas les traiter. C'est un système omnidirectionnel.
Je vous remercie de votre attention et reste à votre disposition pour toute autre question ou complément d'information.
Nous vous invitons à contacter notre service support à travers votre espace client, afin de vous apporter une aide si vous rencontrez des difficultés quelconque. (Contacter le support LWS)
Cordialement, L'équipe LWS