API SMS
Pensée pour les développeurs. Construite pour la performance.

Implémentez notre API d’envoi de SMS MT & de réception de SMS MO vers la France & l’international. Nos SDKs facilitent le développement des fonctionnalités d’envoi & réception de SMS sur-mesure. Nos webservices sont compatibles avec le langage de votre choix (PHP, Java, cURL, .NET, JSON, C#, XML, Python, RUBY, ASP, C++,…).

CONSULTEZ LA DOCUMENTATION DE NOTRE API (PDF – FR)
SEE THE TECHNICAL DOCUMENTATION (PDF – EN)
CONSULTE LA DOCUMENTACIÓN DEL DESARROLLADOR (PDF – EN) CONSULTARE LA DOCUMENTAZIONE DELLO SVILUPPATORE (PDF – EN) BERATEN SIE DIE ENTWICKLERDOKUMENTATION (PDF – EN)

A partir de HT

GUIDE DE DÉMARRAGE
IMPLÉMENTEZ VOTRE PREMIÈRE REQUÊTE…

const ERROR_API = "Error during API call\n";
const ERROR_FILE = "The specified file does not exist\n";
const URL = "https://api.smsmode.com/http/1.6/";
const PATH_SEND_SMS = "sendSMS.do";
const PATH_SEND_SMS_BATCH = "sendSMSBatch.do";

/**
*    Function parameters:
*
*    - accessToken (required)
*    - message (required)
*    - destinataires (required): Receivers separated by a comma
*    - emetteur (optional): Allows to deal with the sms sender
*    - optionStop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
*    - batchFilePath (required for batch mode): The path of CSV file for sms in Batch Mode
*/

class ExempleClientHttpApi 
{
 // send SMS with GET method
 public function sendSmsGet($accessToken, $message, $destinataires, $emetteur, $optionStop) 
 {
     $message = iconv("UTF-8", "ISO-8859-15", $message);
     $fields_string = '?accessToken='.$accessToken.'&message='.urlencode($message).'&numero='.$destinataires.'&emetteur='.$emetteur.'&stop='.$optionStop;
 
     $ch = curl_init();
     curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch,CURLOPT_URL, URL.PATH_SEND_SMS.$fields_string);
     $result = curl_exec($ch);
     curl_close($ch);
     if (!$result) {
         return ERROR_API;
     }
     return $result;
 }

 // send SMS with POST method
 public function sendSmsPost($accessToken, $message, $destinataires, $emetteur, $optionStop) 
 {
     $message = iconv("UTF-8", "ISO-8859-15", $message);
     $fields_string = 'accessToken='.$accessToken.'&message='.urlencode($message).'&numero='.$destinataires.'&emetteur='.$emetteur.'&stop='.$optionStop;
 
     $ch = curl_init();
     curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch,CURLOPT_URL, URL.PATH_SEND_SMS);
     curl_setopt($ch,CURLOPT_POST, 1);
     curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
     $result = curl_exec($ch);
     curl_close($ch);
     if (!$result) {
         return ERROR_API;
     }
     return $result;
 }

 // send SMS with POST method (Batch)
 public function sendSmsBatch($accessToken, $batchFilePath, $optionStop) 
 {
     if (!file_exists($batchFilePath)) {
         return ERROR_FILE;
     }

     $fields_string = '?accessToken='.$accessToken.'&stop='.$optionStop;
     $cfile = new CurlFile($batchFilePath, 'text/csv');
     $data = array('data-binary' => $cfile);

     $ch = curl_init();
     curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'content-type: multipart/form-data'));
     curl_setopt($ch,CURLOPT_URL, URL.PATH_SEND_SMS_BATCH.$fields_string);
     curl_setopt($ch,CURLOPT_POST, 1);
     curl_setopt($ch,CURLOPT_POSTFIELDS, $data);
     $result = curl_exec($ch);
     curl_close($ch);
     if (!$result) {
         return ERROR_API;
     }
     return $result;
 }
}
const urlencode = require('urlencode');
var exports=module.exports={};
const urlencode = require('urlencode');
const http = require('https');
const querystring = require('querystring');
const fs = require('fs');
const pathname = require("path");
const ERROR_API = "Error during API call";
const ERROR_FILE = "The specified file does not exist";
const HOSTNAME = 'api.smsmode.com'
const PATH_SEND_SMS = "/http/1.6/sendSMS.do";
const PATH_SEND_SMS_Batch = "/http/1.6/sendSMSBatch.do";

/**
*    Function parameters:
*
*    - accessToken (required)
*    - message (required)
*    - destinataires (required): Receivers separated by a comma
*    - emetteur (optional): Allows to deal with the sms sender
*    - optionStop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
*    - batchFilePath (required for batch mode): The path of CSV file for sms in Batch Mode
*/

exports.ExempleClientHttpAPI = class {

 // send SMS with GET method
 async sendSmsGet(accessToken, message, destinataires, emetteur, optionStop) {

     var finalPath = PATH_SEND_SMS + '?accessToken=' + accessToken + '&numero=' + destinataires + 
         "&message=" + urlencode(message,'ISO-8859-15') + '&emetteur=' + emetteur + '&stop=' + optionStop;
     const options = {
         hostname: HOSTNAME,
         port: 443,
         path: finalPath,
         method: 'GET'
     };
     try {
         let http_promise = this.getHttpResponse(options, "");
         let response_body = await http_promise;
         return response_body;
     }
     catch(error) {
         return ERROR_API;
     }
 }

 // send SMS with POST method
 async sendSmsPost(accessToken, message, destinataires, emetteur, optionStop) {

     var postData = querystring.stringify({
         'accessToken': accessToken, 
         'numero': destinataires, 
         'emetteur' : emetteur, 
         'stop' : optionStop 
     });
     postData = postData + "&message=" + urlencode(message,'ISO-8859-15');
     const options = {
         hostname: HOSTNAME,
         port: 443,
         path: PATH_SEND_SMS,
         method: 'POST',
         headers: {
             'Content-Type': 'application/x-www-form-urlencoded; charset=ISO-8859-15',
             'Content-Length': Buffer.byteLength(postData)
         }
     };
     try {
         let http_promise = this.getHttpResponse(options, postData);
         let response_body = await http_promise;
         return response_body;
     }
     catch(error) {
         return ERROR_API;
     }
 }

 // send SMS with POST method (Batch)
 async sendSmsBatch(accessToken, batchFilePath, optionStop) {

     var finalPath = PATH_SEND_SMS_Batch + "?accessToken=" + accessToken + "&stop=" + optionStop;
     try {
         let content_file_promise = this.getContentFile(batchFilePath);
         let content = await content_file_promise;
         var boundary = "AaB03x";
         var postData = Buffer.concat([
             Buffer.from("--" + boundary + "\r\n"),
             Buffer.from("Content-Disposition: form-data; name=\"file\"; filename=\""),
             Buffer.from(pathname.basename(batchFilePath) + "\"\r\n"),
             Buffer.from("Content-Type:text/csv\r\n\r\n"),
             Buffer.from(content),
             Buffer.from("\r\n--" + boundary + "--\r\n"),
         ]);
         var options = {
             method: 'POST',
             hostname: HOSTNAME,
             port: 443,
             path: finalPath,
             headers: {
                 "Content-Type": "multipart/form-data; boundary=" + boundary,
                 'Content-Length': Buffer.byteLength(postData)
             }
         };
         try {
         let http_promise = this.getHttpResponse(options, postData);
         let response_body = await http_promise;
         return response_body;
         }
         catch(error) {
             return ERROR_API;
         }
     }
     catch(error) {
         return ERROR_FILE;
     }
 }

 getHttpResponse(options, postData) {
     return new Promise((resolve, reject) => {
         const req = http.request(options, (res) => {
             let chunks_of_data = [];
             res.on('data', (fragments) => {
                 chunks_of_data.push(fragments);
             });
             res.on('end', () => {
                 let response_body = Buffer.concat(chunks_of_data);
                 resolve(response_body.toString());
             });
         });
         req.on('error', (error) => {
             reject(error);
         });
         req.write(postData);
         req.end();
     });
 }

 getContentFile(batchFilePath) {
     return new Promise((resolve, reject) => {
         fs.readFile(batchFilePath, async function(err, content) {
             if (err) {
                 reject(err);
             } else {
                 resolve(content);
             }
         });
     });
 }
}
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.multipart.FilePart;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.util.EncodingUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
*    Parameters:
*
*    - accessToken (required)
*    - message (required)
*    - destinataires (required): Receivers separated by a comma
*    - emetteur (optional): Allows to deal with the sms sender
*    - optionStop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
*    - batchFilePath (required for batch mode): The path of CSV file for sms in Batch Mode
*/

public class ExempleClientHttpAPI {

 private static final String URL = "https://api.smsmode.com/http/1.6/";
 private static final String PATH_SEND_SMS = "sendSMS.do";
 private static final String PATH_SEND_SMS_BATCH = "sendSMSBatch.do";
 private static final String ERROR_FILE = "The specified file does not exist";

 // send SMS with GET method
 public String sendSmsGet(String accessToken, String message, String destinataires, String emetteur, String optionStop) throws IOException {

     HttpClient httpClient = new HttpClient();
     String finalUrl = URL + PATH_SEND_SMS;
     GetMethod httpMethod = new GetMethod(finalUrl);
     httpMethod.addRequestHeader("Content-Type", "plain/text; charset=ISO-8859-15");

     NameValuePair[] params = {
         new NameValuePair("accessToken", accessToken),
         new NameValuePair("message", message),
         new NameValuePair("numero", destinataires),
         new NameValuePair("emetteur", emetteur),
         new NameValuePair("stop", optionStop)
     };

     httpMethod.setQueryString(EncodingUtil.formUrlEncode(params, "ISO-8859-15"));
     httpClient.executeMethod(httpMethod);
     return convertToString(httpMethod.getResponseBodyAsStream()); 
 }

 // send SMS with POST method
 public String sendSmsPost(String accessToken, String message, String destinataires, String emetteur, String optionStop) throws IOException {
     HttpClient httpClient = new HttpClient();
     String finalUrl = URL + PATH_SEND_SMS;
     PostMethod httpMethod = new PostMethod(finalUrl);
     httpMethod.addRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-15");

     NameValuePair[] params = {
         new NameValuePair("accessToken", accessToken),
         new NameValuePair("message", message),
         new NameValuePair("numero", destinataires),
         new NameValuePair("emetteur", emetteur),
         new NameValuePair("stop", optionStop)
     };

     httpMethod.setRequestBody(params);
     httpClient.executeMethod(httpMethod);
     return convertToString(httpMethod.getResponseBodyAsStream());
 }

 // send SMS with POST method (Batch)
 public String sendSmsBatch(String accessToken, String batchFilePath, String optionStop) throws IOException {
     File file = new File(batchFilePath);
     if (!file.exists())
         return ERROR_FILE;

     HttpClient httpClient = new HttpClient();
     String finalUrl = URL + PATH_SEND_SMS_BATCH + "?accessToken=" + accessToken + "&stop=" + optionStop;
     PostMethod httpMethod = new PostMethod(finalUrl);

     Part[] parts = new Part[1];
     parts[0] = new FilePart(file.getName(), file, "text/csv", null);

     httpMethod.setRequestEntity(new MultipartRequestEntity(parts, httpMethod.getParams()));
     httpClient.executeMethod(httpMethod);
     return convertToString(httpMethod.getResponseBodyAsStream());
 }

 private String convertToString(InputStream stream) {
     Scanner sc = new Scanner(stream);
     StringBuilder sb = new StringBuilder();
     while(sc.hasNext()){
         sb.append(sc.nextLine());
     }
     return sb.toString();
 }
}
import requests
import urllib
import sys
import os.path

ERROR_API = "Error during API call"
ERROR_FILE = "The specified file does not exist"
URL = 'https://api.smsmode.com/http/1.6/'
PATH_SEND_SMS = "sendSMS.do"
PATH_SEND_SMS_BATCH = "sendSMSBatch.do"


"""
*    Function parameters:
*
*    - access_token (required)
*    - message (required)
*    - destinataires (required): Receivers separated by a comma
*    - emetteur (optional): Allows to deal with the sms sender
*    - option_stop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
*    - batch_file_path (required for batch mode): The path of CSV file for sms in Batch Mode
"""

class ExempleClientHttpApi:

 # send SMS with GET method
 def send_sms_get(self, access_token, message, destinataires, emetteur, option_stop):

     final_url = (
         URL + PATH_SEND_SMS + 
         '?accessToken=' + access_token + 
         '&message=' + urllib.quote_plus(message.encode('iso-8859-15')) + 
         '&numero=' + destinataires + 
         '&emetteur=' + emetteur + 
         '&stop=' + option_stop
     )
     r = requests.get(final_url)
     if not r:
         return ERROR_API
     return r.text

 # send SMS with POST method
 def send_sms_post(self, access_token, message, destinataires, emetteur, option_stop):

     final_url = URL + PATH_SEND_SMS
     headers = {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}
     payload = {
         'accessToken': access_token,
         'message': message,
         'numero': destinataires,
         'emetteur': emetteur,
         'stop': option_stop
     }
     r = requests.post(final_url, data=payload, headers=headers)
     if not r:
         return ERROR_API
     return r.text

 # send SMS with POST method (Batch)
 def send_sms_batch(self, access_token, batch_file_path, option_stop):

     final_url = URL + PATH_SEND_SMS_BATCH + "?accessToken=" + access_token + "&stop=" + option_stop
     if not os.path.isfile(batch_file_path):
         return ERROR_FILE
     r = requests.post(final_url, files={'file': open(batch_file_path,'rb')})
     if not r:
         return ERROR_API
     return r.text
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Text;
using System.Web;

/**
*    Function parameters:
*
*    - accessToken (required)
*    - message (required)
*    - destinataires (required): Receivers separated by a comma
*    - emetteur (optional): Allows to deal with the sms sender
*    - optionStop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
*    - batchFilePath (required for batch mode): The path of CSV file for sms in Batch Mode
*/

namespace ExempleClientHttpApi
{
 public class ExempleClientHttpApi {

     private static string URL = "https://api.smsmode.com/http/1.6/";
     private static string PATH_SEND_SMS = "sendSMS.do";
     private static string PATH_SEND_SMS_BATCH = "sendSMSBatch.do";
     private static string ERROR_API = "Error during API call\n";
     private static string ERROR_FILE = "The specified file does not exist\n";
     private static readonly HttpClient _httpClient= new HttpClient();
 
     public ExempleClientHttpApi()
     {
         Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
     }

     // send SMS with GET method 
     public string sendSmsGet(string accessToken, string message, string destinataires, string emetteur, string optionStop) { 

         string urlEncodedMessage = HttpUtility.UrlEncode(message, Encoding.GetEncoding("ISO-8859-15"));
         string finalUrl = URL + PATH_SEND_SMS + "?accessToken=" + accessToken + "&numero=" + destinataires + "&message=" + urlEncodedMessage + "&emetteur=" + emetteur + "&stop=" + optionStop;
 
         return Get(finalUrl).Result;
     }

     public static async Task<string> Get(string url){

         try {
             var response = await _httpClient.GetAsync(url);
             string result = await response.Content.ReadAsStringAsync();
             return result;
         } catch (Exception) {
             return ERROR_API;
         }
     }

     // send SMS with POST method 
     public string sendSmsPost(string accessToken, string message, string destinataires, string emetteur, string optionStop) {

         string finalUrl = URL + PATH_SEND_SMS;

         StringBuilder sb = new StringBuilder();
         sb.Append("accessToken=" + accessToken);
         sb.Append("&numero=" + destinataires);
         sb.Append("&emetteur=" + emetteur);
         sb.Append("&message=" + HttpUtility.UrlEncode(message, Encoding.GetEncoding("ISO-8859-15")));
         sb.Append("&stop=" + optionStop);

         return Post(finalUrl ,Encoding.Default.GetBytes(sb.ToString())).Result;
     }

     public static async Task<string> Post(string url, byte[] data){

         ByteArrayContent byteContent = new ByteArrayContent(data);
         byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
         try {
             var response = await _httpClient.PostAsync(url, byteContent);
             string result = await response.Content.ReadAsStringAsync();
             return result;
         } catch (Exception) {
             return ERROR_API;
         }
     }

     // send SMS with POST method (batch)
     public string sendSmsBatch(string accessToken, string batchFilePath, string optionStop) {

         if (!File.Exists(batchFilePath)) {
             return ERROR_FILE;
         }
         string finalUrl = URL + PATH_SEND_SMS_BATCH + "?accessToken=" + accessToken + "&stop=" + optionStop;
         return PostBatch(finalUrl , File.ReadAllBytes(batchFilePath), batchFilePath).Result;
     }

     public static async Task<string> PostBatch(string url, byte[] data, string batchFilePath) {

         var requestContent = new MultipartFormDataContent();
         ByteArrayContent byteContent = new ByteArrayContent(data);
         byteContent.Headers.ContentType = MediaTypeHeaderValue.Parse("text/csv");
         requestContent.Add(byteContent, "file", batchFilePath);
         try {
             var response = await _httpClient.PostAsync(url, requestContent);
             string result = await response.Content.ReadAsStringAsync();
             return result;
         } catch (Exception) {
             return ERROR_API;
         }
     }
 }
}
ResLancement = HTTPRequête("https://api.smsmode.com")
SI ResLancement = Vrai ALORS
 ResCode = HTTPDonneRésultat()
 Info("Code HTML : " + ResCode)
FIN
require 'net/http'
require 'uri'
require 'json'


#    Function parameters:
#
#    - accessToken (required)
#    - message (required)
#    - destinataires (required): Receivers separated by a comma
#    - emetteur (optional): Allows to deal with the sms sender
#    - optionStop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
#    - batchFilePath (required for batch mode): The path of CSV file for sms in Batch Mode

class ExempleClientHttpApi

 ERROR_FILE = "The specified file does not exist";
 URL = "https://api.smsmode.com/http/1.6/"
 PATH_SEND_SMS = "sendSMS.do"
 PATH_SEND_SMS_BATCH = "sendSMSBatch.do"

 def send_sms_get(access_token, message, destinataires, emetteur, option_stop)

     header = {'Content-Type' => 'plain/text; charset=ISO-8859-15'}
     params = { :accessToken => access_token, :message => message.encode(Encoding::ISO_8859_15), :numero => destinataires, :emetteur => emetteur, :stop => option_stop}

     uri = URI.parse(URL + PATH_SEND_SMS);
     uri.query = URI.encode_www_form(params)

     http = Net::HTTP.new(uri.host,uri.port)
     http.use_ssl = true
     request = Net::HTTP::Get.new(uri.request_uri,header)

     res = http.request(request)
     return res.body
 end

 # send SMS with POST method
 def send_sms_post(access_token, message, destinataires, emetteur, option_stop)

     header = {'Content-Type' => 'application/x-www-form-urlencoded; charset=ISO-8859-15'}
     params = { :accessToken => access_token, :message => message.encode(Encoding::ISO_8859_15), :numero => destinataires, :emetteur => emetteur, :stop => option_stop}
     uri = URI.parse(URL + PATH_SEND_SMS);

     http = Net::HTTP.new(uri.host,uri.port)
     http.use_ssl = true
     request = Net::HTTP::Post.new(uri.request_uri,header)
     request.body = URI.encode_www_form(params)

     res = http.request(request)
     return res.body
 end

 # send SMS with POST method (Batch)
 def send_sms_batch(access_token, batch_file_path, option_stop)

     if !File.file?(batch_file_path)
         return ERROR_FILE
     end 

     boundary = "AaB03x"
     header = {'Content-Type' => "multipart/form-data, boundary=#{boundary}"}
     uri = URI.parse(URL + PATH_SEND_SMS_BATCH + '?accessToken=' + access_token + "&stop=" + option_stop);

     post_body = []
     post_body << "--#{boundary}\r\n"
     post_body << "Content-Disposition: form-data; name=\"datafile\"; filename=\"#{File.basename(batch_file_path)}\"\r\n"
     post_body << "\r\n"
     post_body << File.read(batch_file_path)
     post_body << "\r\n--#{boundary}--\r\n"

     http = Net::HTTP.new(uri.host,uri.port)
     http.use_ssl = true
     request = Net::HTTP::Post.new(uri.request_uri, header)
     request.body = post_body.join

     res = http.request(request)
     return res.body
 end

end
import scalaj.http._
import java.nio.file.{Files, Paths}

/**
*    Function parameters:
*
*    - accessToken (required)
*    - message (required)
*    - destinataires (required): Receivers separated by a comma
*    - emetteur (optional): Allows to deal with the sms sender
*    - optionStop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
*    - batchFilePath (required for batch mode): The path of CSV file for sms in Batch Mode
*/

object ExempleClientHttpApi {
 
 var ERROR_FILE = "The specified file does not exist";
 var URL = "https://api.smsmode.com/http/1.6/";
 var PATH_SEND_SMS = "sendSMS.do";
 var PATH_SEND_SMS_BATCH = "sendSMSBatch.do";

 // send SMS with GET method
 def send_sms_get(accessToken:String, message:String, destinataires:String, emetteur:String, optionStop:String) : String = {
     var SendSMSUsingGET = Http(URL + PATH_SEND_SMS)
     .param("accessToken", accessToken)
     .param("message", message)
     .param("numero", destinataires)
     .param("emetteur", emetteur)
     .param("stop", optionStop)
     .charset("ISO-8859-15")
     .asString.body
 
     return SendSMSUsingGET;
 }

 // send SMS with POST method
 def send_sms_post(accessToken:String, message:String, destinataires:String, emetteur:String, optionStop:String) : String = {
     var SendSMSUsingPOST = Http(URL + PATH_SEND_SMS)
     .postForm(
         Seq(
             "accessToken" -> accessToken,
             "message" -> message,
             "numero" -> destinataires,
             "emetteur" -> emetteur,
             "stop" -> optionStop
         )
     )
     .charset("ISO-8859-15")
     .asString.body

     return SendSMSUsingPOST;
 }

 // send SMS with POST method (Batch)
 def send_sms_batch(accessToken:String, batchFilePath:String, optionStop:String) : String = {

     if (!Files.exists(Paths.get(batchFilePath))) {
         return ERROR_FILE;
     }

     var finalUrl : String = URL + PATH_SEND_SMS_BATCH + "?accessToken=" + accessToken + "&stop=" + optionStop;
     var SendSMSUsingPOSTBatch = Http(finalUrl)
     .postMulti(MultiPart("file", Paths.get(batchFilePath).getFileName().toString(), "text/csv", Files.readAllBytes(Paths.get(batchFilePath))))
     .asString.body

     return SendSMSUsingPOSTBatch;
 }
}
#include <iostream>
#include <curl/curl.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>

/**
*    Function parameters:
*
*    - accessToken (required)
*    - message (required)
*    - destinataires (required): Receivers separated by a comma
*    - emetteur (optional): Allows to deal with the sms sender
*    - optionStop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
*    - batchFilePath (required for batch mode): The path of CSV file for sms in Batch Mode
*/

#define URL "https://api.smsmode.com/http/1.6/";
#define PATH_SEND_SMS "sendSMS.do";
#define PATH_SEND_SMS_BATCH "sendSMSBatch.do";
#define ERROR_API "Error during API call";
#define ERROR_FILE "The specified file does not exist";

using namespace std;

static size_t WriteCallback(char *contents, size_t size, size_t nmemb, void *userp)
{
 ((string*)userp)->append((char*)contents, size * nmemb);
 return size * nmemb;
}

class ExempleClientHttpAPI {

 public:

 // send SMS with GET method
 string sendSmsGet(string accessToken, string message, string destinataires, string emetteur, string optionStop) {

     string finalUrl = URL;
     finalUrl += PATH_SEND_SMS;
     finalUrl += "?accessToken=" + accessToken +
     "&message=" + curl_escape(message.c_str(), message.length()) +
     "&numero=" + destinataires +
     "&emetteur=" + emetteur +
     "&stop=" + optionStop;

     string readBuffer;
     CURL *curl;
     CURLcode res;
     curl = curl_easy_init();
     if(curl) {
         curl_easy_setopt(curl, CURLOPT_URL, finalUrl.c_str());
         curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
         curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
         res = curl_easy_perform(curl);
         if(res != CURLE_OK)
         {
             fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
             return ERROR_API;
         }
         curl_easy_cleanup(curl);
     }
     return readBuffer;
 }

 // send SMS with POST method
 string sendSmsPost(string accessToken, string message, string destinataires, string emetteur, string optionStop) {

     string finalUrl = URL;
     finalUrl += PATH_SEND_SMS;
     string postField = "accessToken=" + accessToken + "&message=" + message +
         "&numero=" + destinataires + "&emetteur=" + emetteur + "&stop=" + optionStop;
 
     string readBuffer;
     CURL *curl;
     CURLcode res;
     curl = curl_easy_init();
     if(curl) {
         curl_easy_setopt(curl, CURLOPT_URL, finalUrl.c_str());
         curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postField.c_str());
         curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
         curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
         res = curl_easy_perform(curl);
         if(res != CURLE_OK)
         {
             fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
             return ERROR_API;
         }
         curl_easy_cleanup(curl);
     }
     return readBuffer;
 }

 // send SMS with POST method (Batch)
 string sendSmsBatch(string accessToken, string batchFilePath, string optionStop)
 {
     if(access(batchFilePath.c_str(), F_OK) == -1)
         return ERROR_FILE; 
     string finalUrl = URL;
     finalUrl += PATH_SEND_SMS_BATCH;
     finalUrl += "?accessToken=" + accessToken + 
         "&stop=" + optionStop;
     struct curl_httppost *formpost=NULL;
     struct curl_httppost *lastptr=NULL;
     string readBuffer;
     CURL *curl;
     CURLcode res;
     curl = curl_easy_init();
     if(curl) {
         curl_formadd(&formpost,
             &lastptr,
             CURLFORM_COPYNAME, "sendfile",
             CURLFORM_FILE, batchFilePath.c_str(),
             CURLFORM_END);

         curl_formadd(&formpost,
             &lastptr,
             CURLFORM_COPYNAME, "filename",
             CURLFORM_COPYCONTENTS, batchFilePath.c_str(),
             CURLFORM_END);

         curl_easy_setopt(curl, CURLOPT_URL, finalUrl.c_str());
         curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
         curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
         curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
         res = curl_easy_perform(curl);
         if(res != CURLE_OK)
         {
             fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
             return ERROR_API;
         }
     }
     curl_easy_cleanup(curl);
     return readBuffer;
 }
};

FICHE PRODUIT
LES CARACTÉRISTIQUES DE L’API SMS

FONCTIONNALITÉS INCLUES

L’API basée sur un gateway robuste, permet de monitorer des communications SMS directement dans vos applications. Découvrez les fonctionnalités liées à notre API.

  • une intégration simple et rapide de l’envoi automatisé de SMS MT et des SMS MO réponses dans les systèmes et applications
  • une compatibilité avec les langages de programmation les plus courants (PHP, Java, ASP, C++, Ruby, WINDEV, cURL, .NET, JSON, C#, XML, Python, etc.) pour pouvoir être utilisé avec toutes les applications et solutions logicielles
  • une infrastructure robuste et haute disponibilité traitant plus de 4 millions de requêtes quotidiennement
  • des requêtes HTTP simples permettant l’intégration de fonctionnalités étendues pour l’envoi automatisé de SMS (envoi immédiat ou programmé de SMS, suppression de SMS, historique des SMS, récupération des compte-rendus de réception ou DLR, ajout de contact, notification automatique, personnalisation des émetteurs ou sender ID, etc.)
  • une gestion des priorités d’envoi avec une séparation des trafics SMS marketing, SMS notification et SMS One Time Password sur des canaux différents pour optimiser la délivrabilité des messages critiques
  • la capacité d’envoyer des SMS Pro, des SMS Voix TTS, des SMS OTP ou des SMS Unicode (comportant émoticônes ou caractères issus de langages non latins – cyrillique, grec, arabe, hébreu, chinois, japonais, etc.)
  • le routage des text messages en qualité maximale sur tous les opérateurs en France et dans plus de 166 pays (dont les DOM-TOM)
  • une gestion des réponses et des DLR (comptes-rendus) avec une notification en temps réel

TARIFICATION
TARIFS DE L’API SMS

SMS ENVOYÉS VERS :

WPCS 1.1.4

Les prix en CAD sont approximatifs et basés sur l’application d’un taux de change sur le prix en euro.

FRAIS DE MISE EN PLACE

AUCUN

FRAIS D’UTILISATION

COÛT DES SMS ENVOYÉS
  VOIR LES TARIFS SEE PRICING
  • Durée de validité illimitée des packs de SMS

CONTACTEZ UN DE NOS EXPERTS

NOS AVANTAGES
POURQUOI IMPLÉMENTER L’API SMS SMSMODE© ?

intégration d'une API SMS RESTfulUNE INTÉGRATION FACILE ET UNE STRUCTURE SCALABLE
Notre API prête à l’emploi, est conçue pour l’évolutivité et la performance. Grâce à quelques appels d’API documentés par des SDKs complets, vous intégrez les fonctionnalités d’envoi et de réception SMS, gérez les paramètres d’authentification, les formats de réponse, etc.

SLA de 99,999%UNE API AVEC UN NIVEAU DE SERVICE (SLA) DE 99.999%
Notre infrastructure dédiée et haute disponibilité est monitorée en continu, 24/7, avec résistance à la panne grâce notamment à une solution de basculement du trafic vers des fournisseurs de secours. Le taux de réussite de l’API SMS est ainsi le véritable indicateur de notre expertise.

support client françaisUN SUPPORT CLIENT FRANÇAIS DISPONIBLE 24/7
Nos experts vous accompagnent dans l’implémentation et le suivi des envois de SMS réalisés avec notre webservice. Basés exclusivement en France, à Marseille, ils disposent d’outils performants de monitoring de votre trafic (ElasticSearch, Logstash, Kibana – ELK –).

Besoin de plus d’infos ?
N’hésitez pas à nous contacter.