ESSAYEZ NOTRE API
EN LIGNE
- allez dans Paramètres > API
- cliquez sur Activez votre API Access Key
- recevez votre Access Key par email
Le formulaire d'essai API en ligne est en langue anglaise.
{ "header": [ { "accesskey": "YOUR_ACCESS_KEY", "login": "user@gmail.com", "sender_name": "ArdarySMS", "sender_mode": "1", "date_to_send": "2020-01-02 13:34:00", "priority": 1, "mode":"prod" } ], "messages": [ { "id_sms_api": "09403292039020", "date_to_send": "2020-01-02 13:34:00", "phonenumber": "+1XXXXXXXXXX", "message": "Hi Cassandra, can you confirm our appointement ? \n If you cannot come, lease inform me or change meeting date here [Link].", "url": "https://www.my-link.com", "addReply": 1, "addStop": 0 } ] }
Profitez d'options uniques, rendant la programmation de l'envoi des SMS paramétrables à souhait, et intégrant la réponse SMS, quelque soit le type d'envoi (marketing ou opérationnel).
A besoin d'avoir un compte Ardary Pro .
Unique au monde
Intégrez les messages des téléphones mobiles dans votre logiciel métier (avec séparation des contacts et messages personnels et professionnels), synchronisés avec la boîte Ardary SMS.
A besoin d'avoir Ardary Solo App installé sur les mobiles.
Avec nos API SMS, allez bien plus loin que le simple envoi et la notification de délivrabilité.
Vous pouvez même créer votre propre logiciel SMS, avec l'envoi et la réception de SMS et des outils SMS de relation clients.
Obtenez votre ACCESS KEY dans Ardary SMS in 'paramètres > API'.
NB : la description des API est en anglais.
details +
Why our send SMS API is the most complete on the market ?
It's because a lot of options are given :
URL: https://www.ardary-sms.com/api/sendSms
Method: POST
Request Content-Type: application/json
JSON request data - name and value pairs description :
header :
object with ardary-sms request details; Value: JSON Object
- login (required) : Ardary login (email) of the ardary user to match name of the sender in the Ardary SMS box.
- accesskey (required): YOUR_ACCESS_KEY
- date_to_send (optional) : message sending date
- priority (optional) : message priority Value: Number (0, 1, 2), Default value: 1 (0 : low, 1 : normal, 2 : hight)
- mode (optional) : 'prod' (POST response & sends messages) or 'test' (POST response only).
messages :
List of sms to be sended Value: JSON Array with sms JSON Objects :
- phonenumber (required) : recipient phone number (international format, ex.: +1XXXXXXXXXX).
- message (required) : message body. Important : if you want to add a tracking link you have to add "[Link]" at the right place in the body of the message.
- url (optional) : the link URL you want to track.
- id_sms_api (optional) : the Id you want to give to the message. Otherwise, we create one for you.
- date_to_send (optional) : message sending date (if given in header, this date ... ).
{ "header": [ { "accesskey": "YOUR_ACCESS_KEY", "login": "user@gmail.com", "sender_name": "ArdarySMS", // Not needed for Mobile SMS routing "sender_mode": "1", // Not needed for Mobile SMS routing "date_to_send": "2020-01-02 13:34:00", "priority": 1, "mode":"prod" } ], "messages": [ { "id_sms_api": "09403292039020", "date_to_send": "2020-01-02 13:34:00", "phonenumber": "+1XXXXXXXXXX", "message": "Hi Cassandra, can you confirm our appointement ? \n If you cannot come, lease inform me or change meeting date here [Link].", "url": "https://www.my-link.com", "addReply": 1, // Not needed for Mobile SMS routing "addStop": 0 // Not needed for Mobile SMS routing }, { "id_sms_api": "109O3238932832", "date_to_send": "2020-01-02 13:34:00", "phonenumber": "+1XXXXXXXXXX", "message": "Dear customer, your package has been sent. \n Please inform us if any trouble.", "addReply": 1, // Not needed for Mobile SMS routing "addStop": 0 // Not needed for Mobile SMS routing } ] }
In response of the POST, you get per message :
id_sms_api : the one you sent
sms_per_message : 1 SMS is 160 characters.
sent_time : date of queue of message
phonenumber
message
In case of error, an extra data is given : count_sent, which is the count of messages sent in the list.
In case of success
{ "data": [ { "id_sms_api": "09403292039020", "sms_per_message": 1, "sent_time": "2020-01-02T13:34:37.096Z", "phonenumber": "+1XXXXXXXXXX", "message": "Hi Cassandra, can you confirm our appointement ? \n If you cannot come, please inform me or change meeting date here [link]." }, { "id_sms_api": "109O3238932832", "sms_per_message": 1, "sent_time": "2020-01-02T13:34:37.096Z", "phonenumber": "+1XXXXXXXXXX", "message": "Dear customer, your package has been sent. \n Please inform us if any trouble."" } ] }
In case of error
{ "data":[ { "id_sms_api": "09403292039020", "error":[ "#006" ] }, { "id_sms_api": "109O3238932832", "error":[ "#006" ] } ] }
Error codes :
#001 : Authentification failed
#002 : Your account is not activated yet!
#003 : This phone number asked for stop
#004 : Your sms text contains forbidden words
#006 : Your sms has an empty content
#007 : The phone number is invalid
#009 : Unknown error
SMS routed by OUR SERVERS
//header $accesskey=mysql_escape_string($_POST['accesskey']); $login=$_POST['login']; $sender_name=$_POST['sender_name']; $date_to_send=$_POST['date_to_send']; $marketing=$_POST['marketing']; $header [] = array('login'=>$login,'accessKey'=>$accesskey,'sender_name'=>$sender_name,"mode"=> "prod","date_to_send"=>$date_to_send); //message $phonenumber=$_POST['phonenumber']; $message=$_POST['message']; $urltracking=$_POST['urltracking']; $replylink=$_POST['replylink']; $stoplink=$_POST['stoplink']; $messages [] = array('phonenumber'=>$phonenumber,'message'=>$message,'url'=>$urltracking,"date_to_send"=>$date_to_send,"marketing"=>$marketing,"with_reply"=>$replylink,"add_stop"=>$stoplink); //$json = array('header'=>array('login'=>'radhi.b@ardary.com','accessKey'=>$key,"mode"=> "prod","date_to_send"=>$date_envoi),'messages'=>$mes); $str_messages = array('header'=>array('login'=>$login,'accessKey'=>$accesskey,"mode"=> "prod","date_to_send"=>$date_to_send,'sender_name'=>$sender_name),'messages'=>$messages); $json_messages = json_encode($str_messages); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.ardary-sms.com/api/sendSms", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $json_messages, CURLOPT_HTTPHEADER => array( "Cache-Control: no-cache", "Content-Type: application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "#" . $err; } else { echo $response; }
SMS routed by YOUR MOBILE
//header $accesskey=mysql_escape_string($_POST['accesskey']); $login=$_POST['login']; $date_to_send=$_POST['date_to_send']; $header [] = array('login'=>$login,'accessKey'=>$accesskey,"mode"=> "prod","date_to_send"=>$date_to_send); //message $phonenumber=$_POST['phonenumber']; $message=$_POST['message']; $urltracking=$_POST['urltracking']; $messages [] = array('phonenumber'=>$phonenumber,'message'=>$message,'url'=>$urltracking,"date_to_send"=>$date_to_send); //$json = array('header'=>array('login'=>'radhi.b@ardary.com','accessKey'=>$key,"mode"=> "prod","date_to_send"=>$date_envoi),'messages'=>$mes); $str_messages = array('header'=>array('login'=>$login,'accessKey'=>$accesskey,"mode"=> "prod","date_to_send"=>$date_to_send),'messages'=>$messages); $json_messages = json_encode($str_messages); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.ardary-sms.com/api/sendSmsSolo", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $json_messages, CURLOPT_HTTPHEADER => array( "Cache-Control: no-cache", "Content-Type: application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "#" . $err; } else { echo $response; }
details +
Message delivery status is available by Callback URL
Enter your Callback URL in Ardary dashboard : Parameters > API
Status comes with GET response :
Example using PHP $status_message =json_decode($_GET["status"]);
Here is an example of response :
{ "user":"SENDER_LOGIN", "phonenumber":"RECIPIENT", "status":"received", // values : "sent" or "received" "date_status":"2019-08-09T12:50:54.211Z", "id_sms_api":"YOUR_ID_SMS" // or the one we provide you if empty when sending }
details +
Incoming message is available by Callback URL
Enter your Callback URL in Ardary dashboard : Parameters > API
Incoming message comes with GET response :
Example using PHP $message =json_decode($_GET["message"]);
Here is an example of response :
{ "title":"incoming sms", "from":"+1XXXXXXXXXX", // phone number (international format) "body":"Hello world !", "date":"2020-01-21 10:01:38" }
details +
Clicked link tracking is available by Callback URL
Enter your Callback URL in Ardary dashboard : Parameters > API
Click link tracking comes with GET response :
Example using PHP $click =json_decode($_GET["click"]);
Here is an example of response :
{ "title":"clicked link", "phonenumber":"+1XXXXXXXXXX", // phone number (international format) "link":"https:\/\/www.my-link.com\/", "date":"2019-07-08 15:07:03", "id_sms_api":"YOUR_ID_SMS" // or the one we provide you if empty when sending }
details +
Incoming calls is available by Callback URL
Enter your Callback URL in Ardary dashboard : Parameters > API
Incoming calls comes with GET response :
Example using PHP $call =json_decode($_GET["call"]);
Here is an example of response :
{ "title":"incoming call", "phonenumber":"+1XXXXXXXXXX", "call_date":"2019-07-05 15:11:04" }
details +
In order to synchronize your business software contacts in Ardary SMS for an easy reading of the messages in Ardary SMS.
URL: https://www.ardary-sms.com/api/contact
Method: POST
Request Content-Type: application/json
JSON request data - name and value pairs description :
header :
object with ardary-sms request details; Value: JSON Object
- login (required) : Ardary login (email) of the ardary user to indicate the name of the contact creator in the Ardary SMS box.
- accessKey (required) : YOUR_ACCESS_KEY.
contacts :
- phonenumber (required):contact phone number(international format).
- firstname (optional) : contact first name.
- lastname (optional):contact last name.
- adress (optional) : contact adress.
- email (optional) : contact email.
{ "header": [ { "accesskey": "YOUR_ACCESS_KEY", "login": "user@gmail.com" } ], "contacts": [ { "phonenumber": "+1XXXXXXXXXX", // international format "firstname": "Doe", "lastname": "Joe", "adress": "contact adress" "email": "contact_email@gmail.com" }, { "phonenumber": "+1XXXXXXXXXX", // international format "firstname": "Smith", "lastname": "John", "adress": "contact adress" "email": "contact_email@gmail.com" } ] }
In case of success
{ "data":{ "contact":[ { "phonenumber": "+1XXXXXXXXXX", // international format "firstname": "Doe", "lastname": "Joe", "adress": "contact adress" "email": "contact_email@gmail.com", "result":"success" }, { "phonenumber": "+1XXXXXXXXXX", // international format "firstname": "Smith", "lastname": "John", "adress": "contact adress" "email": "contact_email@gmail.com", "result":"success" } ] } }
In case of error
{ "data":{ "contact":[ { "firstname":"XXXXX", "lastname":"XXXXXXX", "phonenumber":"+XXXXXXXXX", "adress":"", "email":"", "result":"failed", "errors":[ "#001" ] } ] } }
Error codes :
#001 : Invalid phone number
#002 : Empty phone number
#003 : No phone number
#004 : Invalid E-mail