Vous souhaitez développer une application en Python qui permet d'envoyer des SMS ? Consultez nos exemples de codes pour chacune des fonctionnalités disponibles depuis notre API SMS.

				      			
    							import httplib
								import urllib
								import xml.dom.minidom
								import base64
								
								params = urllib.urlencode({'text':'Nouveau message via l'API d'Envoyer SMS Pro depuis un script python','recipients':33600000000,'sendername':'SOCIETE'})
								base64string = base64.encodestring('%s:%s' % (ENVOYERSMSPRO_LOGIN, ENVOYERSMSPRO_PASSWORD))[:-1]
								
								headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain","Authorization":"Basic "+base64string}
								conn = httplib.HTTPSConnection("www.envoyersmspro.com",443)
								conn.request("POST","/api/message/send/",params,headers)
								response = conn.getresponse()
								data = response.read()
								dom = xml.dom.minidom.parseString(data)
								status = dom.getElementsByTagName('status')[0].firstChild.nodeValue
								if status == "success":
								        print "Message envoye : "
								        print "Le messageid  " + dom.getElementsByTagName('message_id')[0].firstChild.nodeValue
								        print "Nombre de SMS envoye : "+ dom.getElementsByTagName('sms_sent')[0].firstChild.nodeValue
								        print "Nombre de SMS restant : " + dom.getElementsByTagName('sms_remaining')[0].firstChild.nodeValue
								else:
								        print "Message non envoye : "
								        print "Request : "+dom.getElementsByTagName('request')[0].firstChild.nodeValue
								        print "Error id : "+dom.getElementsByTagName('error_id')[0].firstChild.nodeValue
								        print "Error message : "+dom.getElementsByTagName('error_message')[0].firstChild.nodeValue
								conn.close()				      			
				      			
    							import httplib
								import urllib
								import xml.dom.minidom
								import base64
								
								params = urllib.urlencode({'messageid':0})
								base64string = base64.encodestring('%s:%s' % (ENVOYERSMSPRO_LOGIN, ENVOYERSMSPRO_PASSWORD))[:-1]
								
								headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain","Authorization":"Basic "+base64string}
								conn = httplib.HTTPSConnection("www.envoyermspro.com",443)
								conn.request("POST","/api/message/stats/",params,headers)
								response = conn.getresponse()
								data = response.read()
								dom = xml.dom.minidom.parseString(data)
								status = dom.getElementsByTagName('status')[0].firstChild.nodeValue
								if status == "success":
								        print "Les statistiques du message : "
								        print ""
								        print "Nombre de SMS recu : "+dom.getElementsByTagName('number_status_1')[0].firstChild.nodeValue
								        print "Nombre de SMS non delivre : "+dom.getElementsByTagName('number_status_2')[0].firstChild.nodeValue
								        print "Nombre de SMS en attente chez l'operateur : "+dom.getElementsByTagName('number_status_3')[0].firstChild.nodeValue
								        print "Nombre de SMS en cours de traitement : "+dom.getElementsByTagName('number_status_4')[0].firstChild.nodeValue
								        print "Nombre de numero en STOP SMS : "+dom.getElementsByTagName('number_status_5')[0].firstChild.nodeValue
								        print ""
								        print "-------"
								        for node in dom.getElementsByTagName('recipient'):
								                currentLine = "Le numero " + node.childNodes[0].firstChild.nodeValue
								                if  node.childNodes[2].firstChild.nodeValue == "1":
								                        currentLine += " a recu le SMS le "+ node.childNodes[1].firstChild.nodeValue
								                elif node.childNodes[2].firstChild.nodeValue == "2":
								                        currentLine += " n'a pas recu le SMS"
								                elif node.childNodes[2].firstChild.nodeValue == "3":
								                        currentLine += " est en attente de livraison par l'operateur"
								                elif node.childNodes[2].firstChild.nodeValue == "4":
								                        currentLine += " est en attente de livraison par Envoyer SMS Pro"
								                elif node.childNodes[2].firstChild.nodeValue == "5":
								                        currentLine += " est en STOP SMS"
								                print currentLine
								                print "-------"
								else:
								        print "Erreur lors de la suppression du compte : "
								        print "Request : "+dom.getElementsByTagName('request')[0].firstChild.nodeValue
								        print "Error id : "+dom.getElementsByTagName('error_id')[0].firstChild.nodeValue
								        print "Error message : "+dom.getElementsByTagName('error_message')[0].firstChild.nodeValue
								conn.close()				      			
				      			
    							import httplib
								import urllib
								import xml.dom.minidom
								import base64
								
								params = urllib.urlencode({'messageid':0})
								base64string = base64.encodestring('%s:%s' % (ENVOYERSMSPRO_LOGIN, ENVOYERSMSPRO_PASSWORD))[:-1]
								
								headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain","Authorization":"Basic "+base64string}
								conn = httplib.HTTPSConnection("www.envoyermspro.com",443)
								conn.request("POST","/api/message/cancel/",params,headers)
								response = conn.getresponse()
								data = response.read()
								dom = xml.dom.minidom.parseString(data)
								status = dom.getElementsByTagName('status')[0].firstChild.nodeValue
								if status == "success":
								        print "Envoi annule : "
								        print ""
								        print "Messageid : "+dom.getElementsByTagName('message_id')[0].firstChild.nodeValue
								        print "Nombre de SMS recredite : "+dom.getElementsByTagName('recredited_sms')[0].firstChild.nodeValue
								        print "Nombre de SMS restant : "+dom.getElementsByTagName('sms_remaining')[0].firstChild.nodeValue
								else:
								        print "Erreur lors de la suppression du compte : "
								        print "Request : "+dom.getElementsByTagName('request')[0].firstChild.nodeValue
								        print "Error id : "+dom.getElementsByTagName('error_id')[0].firstChild.nodeValue
								        print "Error message : "+dom.getElementsByTagName('error_message')[0].firstChild.nodeValue
								conn.close()				      			
				      			
    							import httplib
								import urllib
								import xml.dom.minidom
								import base64
								
								base64string = base64.encodestring('%s:%s' % (ENVOYERSMSPRO_LOGIN, ENVOYERSMSPRO_PASSWORD))[:-1]
								
								headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain","Authorization":"Basic "+base64string}
								conn = httplib.HTTPSConnection("www.envoyersmspro.com",443)
								conn.request("POST","/api/account/getallaccounts/","",headers)
								response = conn.getresponse()
								data = response.read()
								dom = xml.dom.minidom.parseString(data)
								status = dom.getElementsByTagName('status')[0].firstChild.nodeValue
								if status == "success":
								        print "Voici vos comptes : "
								        print ""
								        print "-------"
								        for node in dom.getElementsByTagName('account'):
								                print "L'account id : " + node.childNodes[0].firstChild.nodeValue
								                print "Le nom du compte : " + node.childNodes[1].firstChild.nodeValue
								                print "SMS restant : " + node.childNodes[2].firstChild.nodeValue
								                print "-------"
								else:
								        print "Erreur lors de la suppression du compte : "
								        print "Request : "+dom.getElementsByTagName('request')[0].firstChild.nodeValue
								        print "Error id : "+dom.getElementsByTagName('error_id')[0].firstChild.nodeValue
								        print "Error message : "+dom.getElementsByTagName('error_message')[0].firstChild.nodeValue
								conn.close()				      			
				      			import httplib
								import urllib
								import xml.dom.minidom
								import base64
								
								params = urllib.urlencode({'accountname':'Nouveau compte PYTHON'})
								base64string = base64.encodestring('%s:%s' % (ENVOYERSMSPRO_LOGIN, ENVOYERSMSPRO_PASSWORD))[:-1]
								
								headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain","Authorization":"Basic "+base64string}
								conn = httplib.HTTPSConnection("www.envoyersmspro.com",443)
								conn.request("POST","/api/account/create/",params,headers)
								response = conn.getresponse()
								data = response.read()
								dom = xml.dom.minidom.parseString(data)
								status = dom.getElementsByTagName('status')[0].firstChild.nodeValue
								if status == "success":
								        print "L'accountid " + dom.getElementsByTagName('account_id')[0].firstChild.nodeValue
								else:
								        print "Erreur lors de la creation du compte : "
								        print "Request : "+dom.getElementsByTagName('request')[0].firstChild.nodeValue
								        print "Error id : "+dom.getElementsByTagName('error_id')[0].firstChild.nodeValue
								        print "Error message : "+dom.getElementsByTagName('error_message')[0].firstChild.nodeValue
								conn.close()				      			
				      			import httplib
								import urllib
								import xml.dom.minidom
								import base64
								
								params = urllib.urlencode({'deleteaccountid':0})
								base64string = base64.encodestring('%s:%s' % (ENVOYERSMSPRO_LOGIN, ENVOYERSMSPRO_PASSWORD))[:-1]
								
								headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain","Authorization":"Basic "+base64string}
								conn = httplib.HTTPSConnection("www.envoyersmspro.com",443)
								conn.request("POST","/api/account/delete/",params,headers)
								response = conn.getresponse()
								data = response.read()
								dom = xml.dom.minidom.parseString(data)
								status = dom.getElementsByTagName('status')[0].firstChild.nodeValue
								if status == "success":
								        print "Suppression reussie. Voici vos comptes : "
								        print ""
								        print "-------"
								        for node in dom.getElementsByTagName('account'):
								                print "L'account id : " + node.childNodes[0].firstChild.nodeValue
								                print "Le nom du compte : " + node.childNodes[1].firstChild.nodeValue
								                print "SMS restant : " + node.childNodes[2].firstChild.nodeValue
								                print "-------"
								else:
								        print "Erreur lors de la suppression du compte : "
								        print "Request : "+dom.getElementsByTagName('request')[0].firstChild.nodeValue
								        print "Error id : "+dom.getElementsByTagName('error_id')[0].firstChild.nodeValue
								        print "Error message : "+dom.getElementsByTagName('error_message')[0].firstChild.nodeValue
								conn.close()				      			
				      			
    							import httplib
								import urllib
								import xml.dom.minidom
								import base64
								
								params = urllib.urlencode({'debitaccountid':0,'creditaccountid':0,'sms':1})
								base64string = base64.encodestring('%s:%s' % (ENVOYERSMSPRO_LOGIN, ENVOYERSMSPRO_PASSWORD))[:-1]
								
								headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain","Authorization":"Basic "+base64string}
								conn = httplib.HTTPSConnection("www.envoyersmspro.com",443)
								conn.request("POST","/api/account/transfer/",params,headers)
								response = conn.getresponse()
								data = response.read()
								dom = xml.dom.minidom.parseString(data)
								status = dom.getElementsByTagName('status')[0].firstChild.nodeValue
								if status == "success":
								        print "Transfert reussi."
								        print ""
								        print "---Compte debite---"
								        print "L'account id : " + dom.getElementsByTagName('debitaccount')[0].childNodes[0].firstChild.nodeValue
								        print "Le nom du compte : " + dom.getElementsByTagName('debitaccount')[0].childNodes[1].firstChild.nodeValue
								        print "SMS restant : " + dom.getElementsByTagName('debitaccount')[0].childNodes[2].firstChild.nodeValue
								        print ""
								        print "---Compte credite---"
								        print "L'account id : " + dom.getElementsByTagName('creditaccount')[0].childNodes[0].firstChild.nodeValue
								        print "Le nom du compte : " + dom.getElementsByTagName('creditaccount')[0].childNodes[1].firstChild.nodeValue
								        print "SMS restant : " + dom.getElementsByTagName('creditaccount')[0].childNodes[2].firstChild.nodeValue
								else:
								        print "Erreur lors du transfert : "
								        print "Request : "+dom.getElementsByTagName('request')[0].firstChild.nodeValue
								        print "Error id : "+dom.getElementsByTagName('error_id')[0].firstChild.nodeValue
								        print "Error message : "+dom.getElementsByTagName('error_message')[0].firstChild.nodeValue
								conn.close()				      			
				      			
    							import httplib
								import urllib
								import xml.dom.minidom
								import base64
								
								params = urllib.urlencode({'phonenumber':'33600000000'})
								base64string = base64.encodestring('%s:%s' % (ENVOYERSMSPRO_LOGIN, ENVOYERSMSPRO_PASSWORD))[:-1]
								
								headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain","Authorization":"Basic "+base64string}
								conn = httplib.HTTPSConnection("www.envoyersmspro.com",443)
								conn.request("POST","/api/stopsms/activate/",params,headers)
								response = conn.getresponse()
								data = response.read()
								dom = xml.dom.minidom.parseString(data)
								status = dom.getElementsByTagName('status')[0].firstChild.nodeValue
								if status == "success":
								        print "Le " + dom.getElementsByTagName('phone_number')[0].firstChild.nodeValue + " est maintenant en STOP SMS"
								else:
								        print "Stop SMS non active : "
								        print "Request : "+dom.getElementsByTagName('request')[0].firstChild.nodeValue
								        print "Error id : "+dom.getElementsByTagName('error_id')[0].firstChild.nodeValue
								        print "Error message : "+dom.getElementsByTagName('error_message')[0].firstChild.nodeValue
								conn.close()				      			
				      			
    							import httplib
								import urllib
								import xml.dom.minidom
								import base64
								
								params = urllib.urlencode({'phonenumber':'33600000000'})
								base64string = base64.encodestring('%s:%s' % (ENVOYERSMSPRO_LOGIN, ENVOYERSMSPRO_PASSWORD))[:-1]
								
								headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain","Authorization":"Basic "+base64string}
								conn = httplib.HTTPSConnection("www.envoyersmspro.com",443)
								conn.request("POST","/api/stopsms/deactivate/",params,headers)
								response = conn.getresponse()
								data = response.read()
								dom = xml.dom.minidom.parseString(data)
								status = dom.getElementsByTagName('status')[0].firstChild.nodeValue
								if status == "success":
								        print "Le " + dom.getElementsByTagName('phone_number')[0].firstChild.nodeValue + " n'est plus en STOP SMS"
								else:
								        print "Stop SMS non desactive : "
								        print "Request : "+dom.getElementsByTagName('request')[0].firstChild.nodeValue
								        print "Error id : "+dom.getElementsByTagName('error_id')[0].firstChild.nodeValue
								        print "Error message : "+dom.getElementsByTagName('error_message')[0].firstChild.nodeValue
								conn.close()				      			

Nos autres langages de programmation

Vos packs SMS

section


Envoi de sms groupé
ou à l'unité


  • Sans engagement
  • Sans date limite d'utilisation
  • Sans frais supplémentaires
  • Des prix dégressifs


500 SMS

7,4 cts/unité
37 € HT
Achetez

1000 SMS

7 cts/unité
70 € HT
Achetez

5 000 SMS

6,7 cts/unité
335 € HT
Achetez

10 000 SMS

6,5 cts/unité
650 € HT
Achetez

50 000 SMS

6,2 cts/unité
3 100 € HT
Achetez

100 000 SMS

6 cts/unité
6 000 € HT
Achetez


A la carte

SMS = - € HT soit -cts/unité