Learn how to quickly modify your existing Telesign API calls to send SMS messages using the SMS Gateway Emulator app. With minimal code changes, you can switch from Telesign services to our app, saving costs and gaining full control over your SMS gateway.
There are 2 ways to emulate Telesign API.
Change the API url directly.
Via our Proxy Server.
Whatever you do, make sure to change the Customer_ID
,
API_KEY
to
EMULATOR_Customer_ID
,
EMULATOR_API_KEY
, and set sender_id
with
EMULATOR_SENDER_ID
.
https://developer.telesign.com/enterprise/docs/sms-get-started
Basic authentication and Digest authentication are supported.
curl -X POST "https://rest-ww.telesign.com/v1/messaging" \
--data-urlencode "phone_number=15551212" \
--data-urlencode "message=Hello, from Telesign" \
--data-urlencode "message_type=ARN" \
-u $Customer_ID:$API_KEY
curl -X POST "https://api.smsgatewayemulator.com/v1/messaging" \
--data-urlencode "phone_number=15551212" \
--data-urlencode "message=Hello, from Telesign Emulator" \
--data-urlencode "message_type=ARN" \
--data-urlencode "sender_id=$EMULATOR_SENDER_ID" \
-u $EMULATOR_Customer_ID:$EMULATOR_API_KEY
curl -X POST "https://rest-ww.telesign.com/v1/messaging" \
--data-urlencode "phone_number=15551212" \
--data-urlencode "message=Hello, from Telesign Emulator" \
--data-urlencode "message_type=ARN" \
--data-urlencode "sender_id=$EMULATOR_SENDER_ID" \
-u $EMULATOR_Customer_ID:$EMULATOR_API_KEY \
--cacert ./sms_gateway_emulator_ca.crt \
--proxy https://proxy.smsgatewayemulator.com \
--proxy-cacert ./sms_gateway_emulator_ca.crt
from telesign.messaging import MessagingClient
messaging = MessagingClient(customer_id, api_key)
response = messaging.message(phone_number, message, message_type)
print(response.ok)
from telesign.messaging import MessagingClient
from telesign.util import AuthMethod
# Basic authentication and Digest authentication are supported
# messaging = MessagingClient('EMULATOR_Customer_ID', 'EMULATOR_API_KEY', rest_endpoint='https://api.smsgatewayemulator.com') # Digest authentication is default
messaging = MessagingClient('EMULATOR_Customer_ID', 'EMULATOR_API_KEY', rest_endpoint='https://api.smsgatewayemulator.com', auth_method=AuthMethod.BASIC.value)
response = messaging.message('15551212', 'Hello, from Telesign Emulator', 'ARN', **{"sender_id": 'EMULATOR_SENDER_ID'})
print(response.ok)