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…

$url = 'https://api.smsmode.com/http/1.6';
$pathSendSms = "/sendSMS.do";
$pathSendSmsBatch = "/sendSMSBatch.do";
$accessToken = 'xxxxYYYYYYAAAAAZZZZZZ'; //modify (Required)
$message = 'My Message €€ éé ££££ ùùùù';
$destinataires = '06XXXXXXXXX,07YYYYYYYY'; //Receivers separated by a comma
$emetteur = 'MySenderId'; //Optional parameter, allows to deal with the sms sender
$optionStop = '1'; //Deal with the STOP sms when marketing send (cf. API HTTP documentation)
$batchFilePath = "pathCSVFile"; //modify to define the path of CSV file for sms in Batch Mode

send_sms_get($url, $pathSendSms, $accessToken, $message, $destinataires, $emetteur, $optionStop);
send_sms_post($url, $pathSendSms, $accessToken, $message, $destinataires, $emetteur, $optionStop);
send_sms_batch($url, $pathSendSmsBatch, $accessToken, $batchFilePath, $optionStop);

// send SMS with GET method
function send_sms_get($url, $path, $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_URL, $url.$path.$fields_string);
 $result = curl_exec($ch);
 
 curl_close($ch);
 return $result;
}

// send SMS with POST method
function send_sms_post($url, $path, $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_URL, $url.$path);
 curl_setopt($ch,CURLOPT_POST, 1);
 curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
 
 $result = curl_exec($ch);
 
 curl_close($ch);
 return $result;
}

// send SMS with POST method (Batch)
function send_sms_batch($url, $path, $accessToken, $batchFilePath, $optionStop) {

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

 $ch = curl_init();
 curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'content-type: multipart/form-data' ));
 curl_setopt($ch,CURLOPT_URL, $url.$path.$fields_string);
 curl_setopt($ch,CURLOPT_POST, 1);
 curl_setopt($ch,CURLOPT_POSTFIELDS, $data);
 
 $result = curl_exec($ch);
 
 curl_close($ch);
 return $result;
}
const urlencode = require('urlencode');
const http = require('https');
const querystring = require('querystring');
const fs = require('fs');
var pathname = require("path");

hostname = 'api.smsmode.com'
pathSendSms = "/sendSMS.do";
pathSendSmsBatch = "/sendSMSBatch.do";
accessToken = 'xxxxYYYYYYAAAAAZZZZZZ'; //modify (Required)
message = 'My Message €€ éé ££££ ùùùù';
destinataires = '06XXXXXXXXX,07YYYYYYYY'; //Receivers separated by a comma
emetteur = 'MySenderId'; //Optional parameter, allows to deal with the sms sender
optionStop = '1'; //Deal with the STOP sms when marketing send (cf. API HTTP documentation)
batchFilePath = "pathCSVFile"; //modify to define the path of CSV file for sms in Batch Mode

send_sms_get(hostname, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
send_sms_post(hostname, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
send_sms_batch(hostname, pathSendSmsBatch, accessToken, batchFilePath, optionStop);

// send SMS with GET method
function send_sms_get(hostname, path, accessToken, message, destinataires, emetteur, optionStop) {
 
 var finalPath = '/http/1.6' + path + '?accessToken=' + accessToken + '&numero=' + destinataires + 
     "&message=" + urlencode(message,'ISO-8859-15') + '&emetteur=' + emetteur + '&stop=' + optionStop;
 
 const options = {
     hostname: hostname,
     port: 443,
     path: finalPath,
     method: 'GET'
 };
 const req = send_request(options);
 req.end();
}

// send SMS with POST method
function send_sms_post(hostname, path, accessToken, message, destinataires, emetteur, optionStop) {
 
 var finalPath = '/http/1.6' + path
 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: finalPath,
     method: 'POST',
     headers: {
         'Content-Type': 'application/x-www-form-urlencoded; charset=ISO-8859-15',
         'Content-Length': Buffer.byteLength(postData)
     }
 };
 const req = send_request(options);
 req.write(postData);
 req.end();
}

// send SMS with POST method (Batch)
function send_sms_batch(hostname, path, accessToken, batchFilePath, optionStop) {

 var finalPath = '/http/1.6' + path + "?accessToken=" + accessToken + "&stop=" + optionStop;
 fs.readFile(batchFilePath, function(err, content) {
     if (err){
         console.error(err);
     }
     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)
         }
     };
     const req = send_request(options);
     req.write(postData);
     req.end();
 });
}

function send_request(options) {
 const req = http.request(options, (res) => {
     console.log(`STATUS: ${res.statusCode}`);
     res.on('data', (chunk) => {
         console.log(`BODY: ${chunk}`);
     });
     res.on('end', () => {
         console.log("No more data in response.");
     });
 });
 req.on('error', (e) => {
     console.error("problem with request: ${e.message}");
 });
 return req;
}
package com.calade.tools.temp;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
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.InputStream;
import java.util.Scanner;

public class ExempleClientHttpAPI {

 public ExempleClientHttpAPI() {
     super();
 }

 public static void main(String[] args) {

     String url = "https://api.smsmode.com/http/1.6/";
     String pathSendSms = "/sendSMS.do";
     String pathSendSmsBatch = "/sendSMSBatch.do";
     String accessToken = "xxxxYYYYYYAAAAAZZZZZZ"; //modify (Required)
     String message = "My Message €€ éé ££££ ùùùù";
     String destinataires = "06XXXXXXXXX,07YYYYYYYY"; //Receivers separated by a comma
     String emetteur = "MySenderId"; //Optional parameter, allows to deal with the sms sender
     String optionStop = "1"; //Deal with the STOP sms when marketing send (cf. API HTTP documentation)
     String batchFilePath = "pathCSVFile"; //modify to define the path of CSV file for sms i Batch Mode

     ExempleClientHttpAPI client = new ExempleClientHttpAPI();

     client.send_sms_get(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
     client.send_sms_post(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
     client.send_sms_batch(url, pathSendSmsBatch, accessToken, batchFilePath, optionStop);
 }

 // send SMS with GET method
 public void send_sms_get(String url, String path, String accessToken, String message, String destinataires, String emetteur, String optionStop) {
     try {
         HttpClient httpClient = new HttpClient();
         String finalUrl = url + path;
         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"));
         int codeReponse = httpClient.executeMethod(httpMethod);
         if (codeReponse == HttpStatus.SC_OK || codeReponse == HttpStatus.SC_ACCEPTED) {
             System.out.println(convertToString(httpMethod.getResponseBodyAsStream()));
         }
     } catch (Exception e) {
         e.printStackTrace();
         System.err.println("Error during API call");
     }
 }

 // send SMS with POST method
 public void send_sms_post(String url, String path, String accessToken, String message, String destinataires, String emetteur, String optionStop) {
     try {
         HttpClient httpClient = new HttpClient();
         String finalUrl = url + path;
         PostMethod httpMethod = new PostMethod(finalUrl);
         httpMethod.addRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-15");
 
         NameValuePair data[] = {
             new NameValuePair("accessToken", accessToken),
             new NameValuePair("message", message),
             new NameValuePair("numero", destinataires),
             new NameValuePair("emetteur", emetteur),
             new NameValuePair("stop", optionStop)
         };

         httpMethod.setRequestBody(data);
         int codeReponse = httpClient.executeMethod(httpMethod);
         if (codeReponse == HttpStatus.SC_OK || codeReponse == HttpStatus.SC_ACCEPTED) {
             System.out.println(convertToString(httpMethod.getResponseBodyAsStream()));
         }
     } catch (Exception e) {
         e.printStackTrace();
         System.err.println("Error during API call");
     }
 }

 // send SMS with POST method (Batch)
 public void send_sms_batch(String url, String path, String accessToken, String batchFilePath, String optionStop) {
     try {
         HttpClient httpClient = new HttpClient();
         String finalUrl = url + path + "?accessToken=" + accessToken + "&stop=" + optionStop;
         PostMethod httpMethod = new PostMethod(finalUrl);

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

         httpMethod.setRequestEntity(new MultipartRequestEntity(parts, httpMethod.getParams()));
         int codeReponse = httpClient.executeMethod(httpMethod);
         if (codeReponse == HttpStatus.SC_OK || codeReponse == HttpStatus.SC_ACCEPTED) {
             System.out.println(convertToString(httpMethod.getResponseBodyAsStream()));
         }
     } catch (Exception e) {
         e.printStackTrace();
         System.err.println("Error during API call");
     }
 }

 private String convertToString(InputStream stream) {
     Scanner sc = new Scanner(stream);
     StringBuffer sb = new StringBuffer();
     while(sc.hasNext()){
         sb.append(sc.nextLine());
     }
     return sb.toString();
 }
}
#!/usr/bin/python
# coding=utf-8
import requests
import urllib
import sys

# send SMS with GET method
def send_sms_get(url, path, accessToken, message, destinataires, emetteur, optionStop):

 finalUrl = (url + path + 
     '?accessToken=' + accessToken + 
     '&message=' + urllib.quote_plus(message.encode('iso-8859-15')) + 
     '&numero=' + destinataires + 
     '&emetteur=' + emetteur + 
     '&stop=' + optionStop)
 r = requests.get(finalUrl)

 print r.text

# send SMS with POST method
def send_sms_post(url, path, accessToken, message, destinataires, emetteur, optionStop):

 finalUrl = url + path
 headers = {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}
 payload = {
     'accessToken': accessToken,
     'message': message,
     'numero': destinataires,
     'emetteur': emetteur,
     'stop': optionStop
 }

 r = requests.post(finalUrl, data=payload, headers=headers)
 
 print r.text

# send SMS with POST method (Batch)
def send_sms_batch(url, path, accessToken, batchFilePath, optionStop):

 finalUrl = url + path + "?accessToken=" + accessToken + "&stop=" + optionStop

 r = requests.post(finalUrl, files={'file': open(batchFilePath,'rb')})
 
 print r.text


url = 'https://api.smsmode.com/http/1.6'
pathSendSms = "/sendSMS.do"
pathSendSmsBatch = "/sendSMSBatch.do"
accessToken = 'xxxxYYYYYYAAAAAZZZZZZ' # modify (Required)
message = u'My Message €€ éé ££££ ùùùù'
destinataires = '06XXXXXXXXX,07YYYYYYYY' # Receivers separated by a comma
emetteur = 'MySenderId' # Optional parameter, allows to deal with the sms sender
optionStop = '1' # Deal with the STOP sms when marketing send (cf. API HTTP documentation)
batchFilePath = "pathCSVFile"; #modify to define the path of CSV file for sms in Batch Mode

send_sms_get(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop)
send_sms_post(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop)
send_sms_batch(url, pathSendSmsBatch, accessToken, batchFilePath, optionStop)

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Threading;
using System.Text;
using System.Web;

public class SendSMSExemple {

 private static readonly HttpClient _httpClient= new HttpClient();
 
 public static void Main(string[] args) {
 
     string url = "https://api.smsmode.com/http/1.6";
     string pathSendSms = "/sendSMS.do";
     string pathSendSmsBatch = "/sendSMSBatch.do";
     string accessToken = "xxxxYYYYYYAAAAAZZZZZZ"; //modify (Required)
     string message = "My Message €€ éé ££££ ùùùù";
     string destinataires = "06XXXXXXXXX,07YYYYYYYY"; //Receivers separated by a comma
     string emetteur = "MySenderId"; //Optional parameter, allows to deal with the sms sender
     string optionStop = "1"; //Deal with the STOP sms when marketing send (cf. API HTTP documentation)
     string batchFilePath = "pathCSVFile"; //modify to define the path of CSV file for sms in Batch Mode
 
     SendSMSExemple client = new SendSMSExemple();

     client.send_sms_get(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
     client.send_sms_post(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
     client.send_sms_batch(url, pathSendSmsBatch, accessToken, batchFilePath, optionStop);
 }
 
 // send SMS with GET method 
 public void send_sms_get(string url, string path, string accessToken, string message, string destinataires, string emetteur, string optionStop) { 

     string urlEncodedMessage = HttpUtility.UrlEncode(message, Encoding.GetEncoding("ISO-8859-15"));
     string finalUrl = url + path + "?accessToken=" + accessToken + "&numero=" + destinataires + "&message=" + urlEncodedMessage + "&emetteur=" + emetteur + "&stop=" + optionStop;
 
     string result = Get(finalUrl).Result;
     Console.WriteLine(result);
 }

 public static async Task<string> Get(string url){
 
     using (var response = await _httpClient.GetAsync(url)){
         string result = await response.Content.ReadAsStringAsync();
         return result;
     }
 }

 // send SMS with POST method 
 public void send_sms_post(string url, string path, string accessToken, string message, string destinataires, string emetteur, string optionStop) {
 
     string finalUrl = url + path;

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

     string result = Post(finalUrl ,Encoding.Default.GetBytes(sb.ToString())).Result;

     Console.WriteLine(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");
     using (var response = await _httpClient.PostAsync(url,byteContent)){ 
         string result = await response.Content.ReadAsStringAsync();
         return result;
     }
 }

 // send SMS with POST method (batch)
 public void send_sms_batch(string url, string path, string accessToken, string batchFilePath, string optionStop) {
 
     string finalUrl = url + path + "?accessToken=" + accessToken + "&stop=" + optionStop;
     string result = PostBatch(finalUrl , File.ReadAllBytes(batchFilePath), batchFilePath).Result;

     Console.WriteLine(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);

     using (var response = await _httpClient.PostAsync(url,requestContent)){ 
         string result = await response.Content.ReadAsStringAsync();
         return result;
     }
 }
}
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'

# send SMS with GET method
def send_sms_get(url, path, accessToken, message, destinataires, emetteur, optionStop)

 header = {'Content-Type': 'plain/text; charset=ISO-8859-15'}
 params = { :accessToken => accessToken, :message => message.encode(Encoding::ISO_8859_15), :numero => destinataires, :emetteur => emetteur, :stop => optionStop}
 
 uri = URI.parse(url + path);
 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)
 puts res.code
 puts res.body
end
 
# send SMS with POST method
def send_sms_post(url, path, accessToken, message, destinataires, emetteur, optionStop)

 header = {'Content-Type': 'application/x-www-form-urlencoded; charset=ISO-8859-15'}
 params = { :accessToken => accessToken, :message => message.encode(Encoding::ISO_8859_15), :numero => destinataires, :emetteur => emetteur, :stop => optionStop}
 uri = URI.parse(url + path);
 
 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)
 puts res.code
 puts res.body
end

# send SMS with POST method (Batch)
def send_sms_batch(url, path, accessToken, batchFilePath, optionStop)

 boundary = "AaB03x"

 header = {'Content-Type': "multipart/form-data, boundary=#{boundary}"}
 uri = URI.parse(url + path + '?accessToken=' + accessToken + "&stop=" + optionStop);
 
 post_body = []
 post_body << "--#{boundary}\r\n"
 post_body << "Content-Disposition: form-data; name=\"datafile\"; filename=\"#{File.basename(batchFilePath)}\"\r\n"
 post_body << "\r\n"
 post_body << File.read(batchFilePath)
 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)
 puts res.code
 puts res.body
end

url = "https://api.smsmode.com/http/1.6"
pathSendSms = "/sendSMS.do"
pathSendSmsBatch = "/sendSMSBatch.do"
accessToken = "xxxxYYYYYYAAAAAZZZZZZ" # modify (Required)
message = "My Message €€ éé ££££ ùùùù"
destinataires = "06XXXXXXXXX,07YYYYYYYY" #Receivers separated by a comma
emetteur = "MySenderId" #Optional parameter, allows to deal with sms sender
optionStop = "1" #Allow to deal with STOP sms when marketing send (cf. API HTTP documentation)
batchFilePath = "pathCSVFile" #modify to define the path of CSV file for sms in Batch Mode

send_sms_get(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop)
send_sms_post(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop)
send_sms_batch(url, pathSendSmsBatch, accessToken, batchFilePath, optionStop)
import scalaj.http._
import java.nio.file.{Files, Paths}

object SendSMSExample extends App {

 var url : String = "https://api.smsmode.com/http/1.6";
 var pathSendSms : String = "/sendSMS.do"
 var pathSendSmsBatch : String = "/sendSMSBatch.do"
 var accessToken : String = "xxxxYYYYYYAAAAAZZZZZZ"; //modify (Required)
 var message : String = "My Message €€ éé ££££ ùùùù";
 var destinataires : String = "06XXXXXXXXX,07YYYYYYYY"; //Receivers separated by a comma
 var emetteur : String = "MySenderId"; //Optional parameter, allows to deal with the sms sender
 var optionStop : String = "1"; //Deal with the STOP sms when marketing send (cf. API HTTP documentation)
 var batchFilePath : String = "pathCSVFile"; //modify to define the path of CSV file for sms in Batch Mode

 send_sms_get(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
 send_sms_post(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
 send_sms_batch(url, pathSendSmsBatch, accessToken, batchFilePath, optionStop);

 // send SMS with GET method
 def send_sms_get(url:String, path:String, accessToken:String, message:String, destinataires:String, emetteur:String, optionStop:String) {
     var SendSMSUsingGET = Http(url + path)
     .param("accessToken", accessToken)
     .param("message", message)
     .param("numero", destinataires)
     .param("emetteur", emetteur)
     .param("stop", optionStop)
     .charset("ISO-8859-15")
     .asString.body
 
     println(SendSMSUsingGET)
 }
 
 // send SMS with POST method
 def send_sms_post(url:String, path:String, accessToken:String, message:String, destinataires:String, emetteur:String, optionStop:String) {
     var SendSMSUsingPOST = Http(url + path)
     .postForm(
         Seq(
             "accessToken" -> accessToken,
             "message" -> message,
             "numero" -> destinataires,
             "emetteur" -> emetteur,
             "stop" -> optionStop
         )
     )
     .charset("ISO-8859-15")
     .asString.body
 
     println(SendSMSUsingPOST)
 }
 
 // send SMS with POST method (Batch)
 def send_sms_batch(url:String, path:String, accessToken:String, batchFilePath:String, optionStop:String) {
     var finalUrl : String = url + path + "?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

     println(SendSMSUsingPOSTBatch)
 }
}
#include <iostream>
#include <curl/curl.h>
#include <string.h>
#include <sys/stat.h>

// IMPORTANT ! Compile with -lcurl -fexec-charset=iso-8859-15

// send SMS with GET method
void send_sms_get(std::string url, std::string path, std::string accessToken, std::string message, 
               std::string destinataires, std::string emetteur, std::string optionStop) {

 std::string finalUrl = url + path + 
     "?accessToken=" + accessToken +
     "&message=" + curl_escape(message.c_str(), message.length()) +
     "&numero=" + destinataires +
     "&emetteur=" + emetteur +
     "&stop=" + optionStop;

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

// send SMS with POST method
void send_sms_post(std::string url, std::string path, std::string accessToken, std::string message, 
                std::string destinataires, std::string emetteur, std::string optionStop) {

 std::string finalUrl = url + path;
 std::string postField = "accessToken=" + accessToken + "&message=" + message +
     "&numero=" + destinataires + "&emetteur=" + emetteur + "&stop=" + optionStop;

 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());
     res = curl_easy_perform(curl);
     if(res != CURLE_OK)
         fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
     curl_easy_cleanup(curl);
 }
}

// send SMS with POST method (Batch)
void send_sms_batch(std::string url, std::string path, std::string accessToken, std::string batchFilePath, std::string optionStop) {
 
 std::string finalUrl = url + path + "?accessToken=" + accessToken + "&stop=" + optionStop;

 CURL *curl;
 CURLcode res;
 curl = curl_easy_init();
 if(curl) {
     curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
     curl_easy_setopt(curl, CURLOPT_URL, finalUrl.c_str());
     curl_mime *mime;
     curl_mimepart *part;
     mime = curl_mime_init(curl);
     part = curl_mime_addpart(mime);
     curl_mime_name(part, "File");
     curl_mime_filedata(part, batchFilePath.c_str());
     curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
     res = curl_easy_perform(curl);
     curl_mime_free(mime);
 }
 curl_easy_cleanup(curl);
}

int main(int ac, char **av){

 std::string url = "https://api.smsmode.com/http/1.6";
 std::string pathSendSms = "/sendSMS.do";
 std::string pathSendSmsBatch = "/sendSMSBatch.do";
 std::string accessToken = "xxxxYYYYYYAAAAAZZZZZZ"; //modify (Required)
 std::string message = "My Message €€ éé ££££ ùùùù";
 std::string destinataires = "06XXXXXXXXX,07YYYYYYYY"; //Receivers separated by a comma
 std::string emetteur = "MySenderId"; //Optional parameter, allows to deal with the sms sender
 std::string optionStop = "1"; //Deal with the STOP sms when marketing send (cf. API HTTP documentation)
 std::string batchFilePath = "pathCSVFile"; //modify to define the path of CSV file for sms in Batch Mode

 send_sms_get(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
 send_sms_post(url, pathSendSms, accessToken, message, destinataires, emetteur, optionStop);
 send_sms_batch(url, pathSendSmsBatch, accessToken, batchFilePath, optionStop);

 return 0;
}

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.