Learn how to quickly modify your existing TextLocal API calls to send SMS messages using the SMS Gateway Emulator app. With minimal code changes, you can switch from TextLocal services to our app, saving costs and gaining full control over your SMS gateway.
There are 2 ways to emulate TextLocal API.
Change the API url directly.
Via our Proxy Server.
Whatever you do, make sure to change the API_KEY
to
EMULATOR_API_KEY
, and set
EMULATOR_SENDER_ID
.
https://api.txtlocal.com/docs/sendsms
curl -X POST "https://api.txtlocal.com/send/?" \
--data-urlencode "apikey=$API_KEY" \
--data-urlencode "message=Hello, from TextLocal" \
--data-urlencode "sender=txtlocal" \
--data-urlencode "numbers=447123456789"
curl -X POST "https://api.smsgatewayemulator.com/send/?" \
--data-urlencode "apikey=$EMULATOR_API_KEY" \
--data-urlencode "message=Hello, from TextLocal Emulator" \
--data-urlencode "sender=$EMULATOR_SENDER_ID" \
--data-urlencode "numbers=447123456789"
curl -X POST "https://api.txtlocal.com/send/?" \
--data-urlencode "apikey=$EMULATOR_API_KEY" \
--data-urlencode "message=Hello, from TextLocal Emulator" \
--data-urlencode "sender=$EMULATOR_SENDER_ID" \
--data-urlencode "numbers=447123456789" \
--cacert ./sms_gateway_emulator_ca.crt \
--proxy https://proxy.smsgatewayemulator.com \
--proxy-cacert ./sms_gateway_emulator_ca.crt
import urllib.request
import urllib.parse
def sendSMS(apikey, numbers, sender, message):
data = urllib.parse.urlencode({'apikey': apikey, 'numbers': numbers, 'message' : message, 'sender': sender})
data = data.encode('utf-8')
request = urllib.request.Request("https://api.txtlocal.com/send/?")
f = urllib.request.urlopen(request, data)
fr = f.read()
return(fr)
resp = sendSMS('apikey', '447123456789', 'Jims Autos', 'This is your message')
print (resp)
import urllib.request
import urllib.parse
def sendSMS(apikey, numbers, sender, message):
data = urllib.parse.urlencode({'apikey': apikey, 'numbers': numbers, 'message' : message, 'sender': sender})
data = data.encode('utf-8')
request = urllib.request.Request("https://api.smsgatewayemulator.com/send/?")
f = urllib.request.urlopen(request, data)
fr = f.read()
return(fr)
resp = sendSMS('EMULATOR_API_KEY', '447123456789', 'EMULATOR_SENDER_ID', 'Hello, from TextLocal Emulator')
print (resp)