DOCUMENTAZIONE API SMS STAR
Di seguito vediamo un esempio di script PYTHON per eseguire le seguenti funzioni:
INVIO SMS
RICEVERE
STATO DEL SMS INVIATO
RICEVERE
COSTO DEL SMS
INVIATO
RICEVERE
IL SALDO DEI CREDITI A DISPOSIZIONE
Prima di visualizzare l'esempio di script riportato qui di seguito leggi le impostazioni da effettuare nel tuo pannello di controllo. Trovi tali indicazioni nella pagina: http://www.smsstar.it/api.htm
ESEMPIO SCRIPT in PYTHON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | login = ""password = "" phone_sms = "380633333131"msg_id = "123456"send_sms = '''<?xml version="1.0" encoding="UTF-8"?><SMS><operations><operation>SEND</operation></operations><authentification><username>%s</username><password>%s</password></authentification><message><sender>SMS</sender><text>Test message [UTF-8]</text></message><numbers><number messageID="%s">%s</number></numbers></SMS>''' % (login, password, phone_sms, msg_id)import urllib2, urllibsenddata=[('XML',send_sms)]senddata=urllib.urlencode(senddata)path='http://www.smsstar.it/account/xml.php'req=urllib2.Request(path, senddata)req.add_header("Content-type", "application/x-www-form-urlencoded")result=urllib2.urlopen(req).read()print result |
RICEVERE STATO DEL SMS INVIATO
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | login = ""password = "" phone_sms = "380633333131"msg_id = "123456"get_sms_status = '''<?xml version="1.0" encoding="UTF-8"?><SMS><operations><operation>SEND</operation></operations><authentification><username>%s</username><password>%s</password></authentification><statistics><messageid>%s</messageid></statistics></SMS>''' % (login, password, msg_id)import urllib2, urllibsenddata=[('XML',get_sms_status)]senddata=urllib.urlencode(senddata)path='http://www.smsstar.it/account/xml.php'req=urllib2.Request(path, senddata)req.add_header("Content-type", "application/x-www-form-urlencoded")result=urllib2.urlopen(req).read()print result |
RICEVERE COSTO SMS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | login = ""password = "" phone_sms = "380633333131"msg_id = "123456"get_send_price = '''<?xml version="1.0" encoding="UTF-8"?><SMS><operations><operation>GETPRICE</operation></operations><authentification><username>%s</username><password>%s</password></authentification><message><sender>SMS</sender><text>Test message [UTF-8]</text></message><numbers><number messageID="%s">%s</number></numbers></SMS>''' % (login, password, phone_sms, msg_id)import urllib2, urllibsenddata=[('XML',get_send_price)]senddata=urllib.urlencode(senddata)path='http://www.smsstar.it/account/xml.php'req=urllib2.Request(path, senddata)req.add_header("Content-type", "application/x-www-form-urlencoded")result=urllib2.urlopen(req).read()print result |
RICEVERE IL SALDO DEI CREDITI A DISPOSIZIONE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | login = ""password = "" phone_sms = "380633333131"msg_id = "123456"get_balance = '''<?xml version="1.0" encoding="UTF-8"?><SMS><operations><operation>BALANCE</operation></operations><authentification><username>%s</username><password>%s</password></authentification></SMS>''' % (login, password)import urllib2, urllibsenddata=[('XML',get_balance)]senddata=urllib.urlencode(senddata)path='http://www.smsstar.it/account/xml.php'req=urllib2.Request(path, senddata)req.add_header("Content-type", "application/x-www-form-urlencoded")result=urllib2.urlopen(req).read()print result |
ESEMPI DI SCRIPT PER INVIARE SMS TRAMITE IL GATEWAY DI SMSSTAR
Script in PHP per Inviare SMS
Script in C# per Inviare SMS
Script in Java per Inviare SMS
Script in Perl per Inviare SMS
Script in Python per Inviare SMS
English
Deutsch
Espanol
Francais
Russian
Ukrainian
Portuguese
Italiano
Turkish
Polish






