import urllib # Python URL functions
import urllib2 # Python URL functions
userid= YOUR_USERID
password=YOUR_PASSWORD
vasid=YOUR_VASID
to = "16092223333" # Multiple mobiles numbers separated by comma.
text = "Test message" # Your message to send.
from = "27126" # Specify your short code or virtual number
# Prepare the post parameters
values = {
'userid' : userid,
'password' : password,
'vasid' :vasid,
'to' : to,
'text' : text,
'from' : from
}
url = "https://msgapi.wire2air.com/smsapi/submitsm.aspx" # API URL
postdata = urllib.urlencode(values) # URL encoding the data here.
req = urllib2.Request(url, postdata)
response = urllib2.urlopen(req)
output = response.read() # Get Response
print output # Print Response