What types of RCS messages for your company?Read the article What kind of RCS messages for your company?More information What kind of RCS messages for your company?More information Quali tipi di messaggi RCS per la vostra azienda?Ulteriori informazioni Welche Arten von RCS-Meldungen für Ihr Unternehmen?Mehr Informationen

Integrate the sending of SMS from your application with Python

Follow our quick start guide to set up the API call code SMS and deploy your web or application project in Python. Implement the request and immediately receive the SMS sent by Python.

THE TRUST OF YOUR FAVORITE COMPANIES

Send SMS Python, in detail

With the API SMSyou can create any service, from a simple notification or marketing service SMS to two-factor authentication (OTP) solutions.

Quick and easy API integration

Our API's HTTP GET and POST requests are compatible with a wide range of programming languages, and our free documentation makes integration quick and easy.

Maximum safety

Hosted in France, in a level 4 data-center, our SMS APIs guarantee maximum security, thanks in particular to the HTTPS protocol. Our solution is ISO 27001 & 27701 certified.

Continuous service

Our dedicated infrastructure is highly available. It is continuously monitored 24 hours a day, 7 days a week, 365 days a year, and is redundant and fault-tolerant.

Technical support at your service

Our dedicated team of developers is on hand to help you integrate our APIs SMS, keep the service running smoothly and answer any questions you may have.

TO FIND OUT MORE
Subscription formulas for ultra-competitive rates
subscription form

QUICK START GUIDE

Start sending SMS with Python

The SMS HTTP API lets you integrate a wide range of requests into your Python development: sending a SMS (in bulk or individually), receiving SMS customers, and also receiving statistics on your mailings SMS.

Integrate SMS with Python in just a few lines

1/ The first parameter imported corresponds to the token (API key) that identifies you to make the request via our gateway SMS
2/ The second contains the content of the message to be sent
3/ The third parameter contains the telephone number(s) of the recipients.


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

Congratulations! You've just sent your first SMS.

Consult the HTTP API developer documentation and its parameters to explore the full range of functionalities offered by our Gateway SMS (mailing, sending date and time management, sender customization, response reception, etc.).

Get 20 free Python SMS by creating your account

No credit card required. 30 seconds fast!

Choose France's leading API provider

Our SMS upload interface is quick to install and compatible with a wide range of programming languages (PHP, Java, Javascript, ASP, C++, C#, Ruby, Python, SKD, WINDEV, .net, etc.).

Route SMS shipments along the best routes

As an ARCEP telecom operator, SMS sent via our services are routed via direct operator routes (maximum quality). You benefit from maximum deliverability: a reception rate of +99%, including 87% within one minute Next being sent to French telephone operators.

Real-time monitoring and supervision

Traffic passing through our Gateway SMS is continuously monitored. Our Kibana monitoring system enables real-time tracking of SMS dispatch performance and detailed deliverability statistics, as well as alerts concerning possible system slowdowns.

High-availability infrastructure

Approved by more than 10,000 customers, our platform SMS platform handles over 1 million requests per day, for a sending volume of over 900 million SMS messages per year. The management of sending priorities (prioritization of OTP traffic and notification of marketing traffic) is also optimized for better performance.

REPORT
Digital security at smsmode© ?
Discover our data protection and privacy measures designed with RGPD compliance in mind.
safety report smsmode

Create your free account

Try out our SMS platform and benefit from 20 free test credits, with no obligation.

Need more info?
We look forward to hearing from you.