SMS API

SMS-API
Für Entwickler gedacht. Für Leistung gebaut.

Implementieren Sie unsere API, um SMS MT zu senden und SMS MO an Frankreich & International zu empfangen. Unsere SDKs erleichtern die Entwicklung von benutzerdefinierten SMS-Senden und Empfangen. Unsere Webdienste sind mit der Sprache Ihrer Wahl kompatibel (PHP, Java, CURL, .net, JSON, C#, XML, Python, RUBY, ASP, C++,...).

SEHEN SIE SICH DIE DOKUMENTATION UNSERER API AN (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)

STARTANLEITUNG
IMPLEMENTIEREN SIE IHRE ERSTE ABFRAGE...

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;
         }
     }
 }
}
/**
*     Funktionsparameter:
*
*     - accessToken (erforderlich)
*     - Nachricht (erforderlich)
*     - Empfänger (erforderlich): Empfänger durch Komma getrennt
*     - Sender (wahlweise): Erlaubt den Umgang mit dem Absender der SMS
*     - OptionStop (wahlweise): Umgang mit dem STOP sms beim Marketingversand (vgl. API HTTP-Dokumentation)
*     - batchFilePath (für den Batch-Modus erforderlich): Der Pfad der CSV-Datei für sms im Batch-Modus
*/

ExampleClientHttpApi ist eine Klasse

 URL ist eine Zeichenfolge = "https://api.smsmode.com/http/1.6/".
 PATH_SEND_SMS ist eine Zeichenfolge = "sendSMS.do".
 PATH_SEND_SMS_BATCH ist eine Zeichenfolge = "sendSMSBatch.do".
FIN

VERFAHREN Builder()

VERFAHREN Vernichter()


PROCEDURE sendSmsGet(accessToken ist eine Zeichenkette, Nachricht ist eine Zeichenkette, Empfänger ist eine Zeichenkette, Absender ist eine Zeichenkette, optionStop ist eine Zeichenkette)

getField ist eine Kette
getField = "?accessToken=" + accessToken + "&message=" + Nachricht + "&number=" + Empfänger + "&sender=" + Sender + "&stop=" + OptionStop

IF HTTQuery(URL + PATH_SEND_SMS + getField) = Wahr-DANN
 REFER HTMLVersTexte(HTTPDatenErgebnis(httpErgebnis))
SINON
 REFER FehlerInfo()
FIN


PROCEDURE sendSmsPost(accessToken ist eine Zeichenkette, Nachricht ist eine Zeichenkette, Empfänger ist eine Zeichenkette, Absender ist eine Zeichenkette, optionStop ist eine Zeichenkette)

postField ist ein Kanal
postField = "accessToken=" + accessToken + "&message=" + Nachricht + "&number=" + Empfänger + "&sender=" + Sender + "&stop=" + OptionStop

IF HTTQuery(URL + PATH_SEND_SMS, "", "", postField) = Wahr-DANN
 REFER HTMLVersTexte(HTTPDatenErgebnis(httpErgebnis))
SINON
 REFER (FehlerInfo())
FIN


PROCEDURE sendSmsBatch(accessToken ist eine Zeichenkette, batchFilePath ist eine Zeichenkette, optionStop ist eine Zeichenkette)

fdFile ist eine ganze Zahl
fdFile = fOuvre(batchFilePath)
WENN fdDDatei = -1 DANN
 REFER ("Die angegebene Datei existiert nicht")
FIN
contentFile ist ein Kanal
contentFile = fLit(fdFile,fSize(batchFilePath))
fFarm(fdDatei)


Header ist eine Zeichenkette = "multipart/form-data; boundary=" + boundary

postField ist ein Kanal
postFeld = "--". + Grenze + RC +
Inhalt-Disposition: form-data; name=""datendatei""; dateiname=" + batchFilePath + """ + RC + RC + RC + 
contentDatei + 
RC + "--" + Grenze + "--"

IF HTTQuery(URL + PATH_SEND_SMS_BATCH + "?accessToken=" + accessToken +"&stop=" + optionStop, "", "", postField, header) = True THEN
 REFER HTMLVersTexte(HTTPDatenErgebnis(httpErgebnis))
SINON
 REFER (FehlerInfo())
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;
 }
};

API REFERENZEN
DIE ERFORDERLICHEN RESSOURCEN
ZUR IMPLEMENTIERUNG DER SMS-API

API-SCHLÜSSEL

GITHUB PHP LIBRARY
(Version 2.8.1 von smsmode© als konform zertifiziert - spätere Versionen werden nicht überprüft)

PRODUKTBLATT
DIE EIGENSCHAFTEN DER SMS API

EINGESCHLOSSENE FUNKTIONEN

Die API, die auf einem robusten Gateway basiert, ermöglicht die Überwachung von SMS-Kommunikation direkt in Ihren Anwendungen. Erfahren Sie mehr über die mit unserer API verbundenen Funktionen.

  • eine einfache und schnelle Integration des automatisierten Versands von MT-SMS und MO-SMS-Antworten in Systeme und Anwendungen
  • Kompatibilität mit den gängigsten Programmiersprachen (PHP, Java, ASP, C++, Ruby, WINDEV, cURL, .NET, JSON, C#, XML, Python usw.), sodass sie mit allen Anwendungen und Softwarelösungen verwendet werden kann.
  • eine robuste, hochverfügbare Infrastruktur, die täglich mehr als 4 Millionen Anfragen bearbeitet
  • einfache HTTP-Anfragen, die die Integration umfangreicher Funktionen für den automatisierten SMS-Versandermöglichen (sofortiger oder geplanter SMS-Versand, Löschen von SMS, SMS-Verlauf, Abrufen von Empfangsprotokollen oder DLRs, Hinzufügen von Kontakten, automatische Benachrichtigung, Personalisierung der Absender oder sender ID usw.).
  • eine Verwaltung der Versandprioritäten mit einer Trennung des SMS-Marketing-, SMS-Benachrichtigungs- und SMS-One Time Password-Verkehrs auf verschiedenen Kanälen, um die Zustellbarkeit kritischer Nachrichten zu optimieren
  • die Möglichkeit, Pro-SMS, TTS-Sprachen-SMS, OTP-SMS oder Unicode-SMS (mit Emoticons oder Zeichen aus nicht-lateinischen Sprachen - Kyrillisch, Griechisch, Arabisch, Hebräisch, Chinesisch, Japanisch usw.) zuversenden.
  • das Routing von Textnachrichten in höchster Qualität über alle Betreiber in Frankreich und in über 166 Ländern (einschließlich der französischen Überseegebiete)
  • eine Verwaltung der Antworten und DLRs (Berichte) mit Echtzeitbenachrichtigung

TARIFIERUNG
SMS API TARIFE

WÄHLEN SIE DAS ZIEL DER GESENDETEN SMS

WÄHRUNG AUSWÄHLEN

WPCS 2.1.4

Preise in $US, £ und $CA sind Näherungswerte und basieren auf der Anwendung eines Wechselkurses auf den Preis in Euro.

KOSTEN SENKEN

KEINE

NUTZERGEBÜHREN

KOSTEN FÜR SMS SENT
  SIEHE PREISE SEE PRICING
  • Unbegrenzte Gültigkeitsdauer von SM-Packs

KONTAKTIEREN SIE EINE UNSERER EXPERTS

UNSERE VORTEILE
WARUM SOLLTE MAN DIE SMS API SMSMODE© IMPLEMENTIEREN?

Integration einer SMS RESTful API

EINFACHE INTEGRATION UND SKALIERBARE STRUKTUR

Unsere einsatzbereite API ist für Skalierbarkeit und Leistung ausgelegt. Mit ein paar API-Anrufen, die durch komplette SDKs dokumentiert sind, integrieren Sie SMS-Senden-und Empfangsfunktionen, verwalten Authentifizierungseinstellungen, Antwortformate und vieles mehr.

99,999% SLA

EINE API MIT EINEM SERVICELEVEL (SLA) VON 99,999%.

Unsere dedizierte und hochverfügbare Infrastruktur wird kontinuierlich überwacht, 24/7, mit Widerstand gegen Ausfälle dank einer Lösung für den Umstieg auf den Datenverkehr auf Backup-Anbieter. Die Erfolgsquote der SMS API ist somit der eigentliche Indikator für unsere Kompetenz.

Französischer Kundenservice

EINEN DEUTSCHEN KUNDENSUPPORT, DER 24/7 VERFÜGBAR IST

Unsere Experten begleiten Sie bei der Umsetzung und Nachbereitung der SMS-Nachrichten, die mit unserem Webservice gemacht werden. Sie sind ausschließlich in Frankreich, Marseille ansässig und verfügen über leistungsstarke Werkzeuge zur Überwachung Ihres Datenverkehrs (ElasticSearch, Logstash, Kibana – ELK –).

Benötigen Sie weitere Informationen?
Zögern Sie nicht, uns zu kontaktieren.