Python Sample Code Send SMS
import urllib # Python URL functions
import urllib2 # Python URL functions
authkey = "YourAuthKey" # Your authentication key.
mobileNumber = "9999999999" # Multiple mobiles numbers separated by comma.
senderId = "112233" # Sender ID,While using route4 sender id should be 6 characters long.
message = "Test message" # Your message to send.
pe_id = "12131313131313131" # Your approved Principal Entity Id.
template_id = "12454524223223223" # Your approved DLT Template Id.
route = "default" # Define route
# Prepare you post parameters
values = {
'authkey' : authkey,
'mobiles' : mobiles,
'senderId' : sender,
'message' : mobileNumber,
'pe_id' : pe_id,
'template_id' : template_id,
'route' : route
}
url = "https://apitxt.com/api/sendMsg" # 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