NOTE: You will need to be Level 2 Verified to send SMS or MMS via Alphanumeric Sender ID
A Step by Step Guide for an Echo SMS Service
Let's start with sending SMS
- Buy a SMS-enabled number.
- Set up a Messaging Profile. No need to do anything on the inbound side yet. We will do that later.
At this stage, you are ready to send SMS.
- Open up Postman. "POST" to "https://sms.telnyx.com/messages"
- In "Headers", set your "x-profile-secret" to the secret under your Messaging Profile.
- In the "Body", you can paste in the following:
"from": "+1[your messaging-enabled number]",
"to": "+1[intended recipient]",
"body": "Hello World"
Here is a video demo showing the POSTMAN setup & SMS action
You have sent your first SMS!
Now let's build an echo SMS receive server.
- You need a domain
- You need a host
- You need the domain name to resolve to the said host
- You need to configure your firewall such that outside traffic can access your host, please allow the subnet 126.96.36.199/27.
- In your particular messaging profile, under "Inbound", put in your URL: "http://my-host.my-domain.com"
The above steps will make sure Telnyx knows where to deliver your messages and the messages won't be dropped by your firewall. As a sanity check, ssh into your host and start a simple HTTP server that does nothing yet.
user@sms-demo:~$ sudo python -m SimpleHTTPServer 80
Serving HTTP on 0.0.0.0 port 80 ...
Send an SMS to your SMS-enabled number and you should see something similar to the following:
10.15.2.34 - - [27/Jul/2017 19:15:33] code 501, message Unsupported method ('POST')
10.15.2.34 - - [27/Jul/2017 19:15:33] "POST / HTTP/1.1" 501 -
Now, you actually need to write a server that handles the POST request that comes in from Telnyx. If you need help to set up your first server, please use this GitHub repository as a starting point.
Here is a demo video of receiving SMS by configuring a Web-hook to messaging profile.
Sending SMS through Alphanumeric ID
Alphanumeric Sender ID allows you to set your brand or company's name as the Sender ID when sending one-way SMS.
Alphanumeric Sender ID can be set dynamically on the POST request to our API when sending an SMS. You just need to set a valid alphanumeric ID in the FROM field and we will use that.
Consider that you need to have your account verified to Level 2 in order to use this feature. Also USA and Canadian carriers block Alphanumeric ID so this feature will not work in USA and Canada.
If you want a more in depth discussion on our messaging services, check out our webinar below.