Using RESTful API to send text messages
Back to Articles
SMS SMPP API Reference Telecom Howto

Using RESTful API to send text messages

November 1, 2018 2 min
Aivis Olsteins

Aivis Olsteins

Sending text messages is one of the most recent features added to SAARA system. It supports several ways to deliver Mobile Terminated (MT) messages to the end client:

  1. Most simplest way is to open a web interface on SAARA server, login as end user and send SMS from there. It is simple and handy for one off sending of one or few messages. It is not suitable for server-to-server connection or automated message delivery.
  2. SMPP protocol is industry standard for text message sending between Message Entities (ESMEs) and Mesage Centers. However, it requries implementation of SMPP which is not always straigh forward and easy.
  3. RESTful APIs are a popular method for machine-to-machine communication, and can be implemented much easier, since there are plenty of free and commercial suftware packages, libraries and tools which implement or support this functionality.

Here we will discuss the latter method. The step by stepo guide of how to set up SAARA system for MT message sending can be found at this link, and more specifically, the guide how to set up API support for SMS sending is located here.

The API is implemented with following API call:

POST /sms/send

{
  "to": "1234567890",
  "from": "9876543210",
  "content": "Hello, world!"
}

The above request sends text mesage "Hello, world" to phone number 1234567890 and the sender ID displayed on the recipients screen will be 987654321

The API will respond with confirmation where the body will contain message like:

{
  "code": 0,
  "status": 200,
  "data": "accepted",
  "request_id": "29737936-96c9-496f-aa13-1cd3a4544417"
}

Note, there is request_id attribute in response. It can be used in further requests to obtain status of the message delivery and billing data if necessary.

API client can be implemented in many languages. The quickest way, without actually writing any line of code is either via browser addons, like RESTClient add-on for Mozilla Firefox or Advanced REST Client for Google Chrome. Other way is to use curl, Linux CLI tool:

curl -X POST -H 'Authorization: token U51U9KhRl0t53n9W' -i 'http://server.address/api/sms/send' --data '{
    "to": "1234567890",
    "from":"9876543210",
    "content":"Hello world!"
}'

 

Share this article

Aivis Olsteins

Aivis Olsteins

An experienced telecommunications professional with expertise in network architecture, cloud communications, and emerging technologies. Passionate about helping businesses leverage modern telecom solutions to drive growth and innovation.

Related Articles

The Commitment Economy: Why Voice AI Bookings Must Be Integrated, Not Just Conversational

The Commitment Economy: Why Voice AI Bookings Must Be Integrated, Not Just Conversational

AI can promise a booking, but what about the broken promise? Learn why systemic integration, Accuracy Rate, and System Sync define the real test of Voice AI reliability

Read Article
Beyond the Dial Tone: 3 Metrics That Define Outbound AI Success

Beyond the Dial Tone: 3 Metrics That Define Outbound AI Success

Outbound AI requires a new scorecard. Learn the 3 metrics (Connection Rate, Engagement Quality, and Conversion Impact) that measure pipeline movement, not just call volume

Read Article
The New AI Scorecard: How to Measure Campaign Effectiveness Beyond "Call Volume"

The New AI Scorecard: How to Measure Campaign Effectiveness Beyond "Call Volume"

Stop guessing with 'Call Volume'. Discover the 3-Layer Framework for measuring Voice AI success: Goal Completion Rate (GCR), Sentiment Drift, and Knowledge Retrieval. Turn phone calls into structured marketing data

Read Article
What Happens to Metrics When "Hold Time" Hits Zero?

What Happens to Metrics When "Hold Time" Hits Zero?

Does Voice AI just save money? No. Discover the "CSAT Paradox" and how zero hold time improves revenue, lead capture, and team morale simultaneously.

Read Article

SUBSCRIBE TO OUR NEWSLETTER

Stay up to date with the latest news and updates from our telecom experts