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

How Voice AI Reduces Agent Burnout and Boosts Satisfaction

How Voice AI Reduces Agent Burnout and Boosts Satisfaction

Reduce Burnout with Voice AI: Offload Repetitive Calls, Real‑Time Agent Assist, 40–80% Less ACW, Calmer Escalations, Healthier Occupancy, Proactive Deflection & PCI‑Safe Flows—Happier Agents, Faster Resolutions, Better Coaching, Faster Ramp

Read Article
Seamless Voice AI Integrations: Salesforce, HubSpot, and ERP Systems

Seamless Voice AI Integrations: Salesforce, HubSpot, and ERP Systems

Seamless Voice AI Integrations with Your Stack: Salesforce & HubSpot CRM + SAP/Oracle/NetSuite/Dynamics ERP; OAuth2 & mTLS Security; Real‑Time Read/Write (Cases, Orders, Payments, Scheduling); Warm Transfers, Context; Audit Logs, SLAs, iPaaS Support

Read Article
Measuring Voice AI Success: The KPIs That Matter—CSAT, Containment, Speed, Accuracy, Reliability, and ROI

Measuring Voice AI Success: The KPIs That Matter—CSAT, Containment, Speed, Accuracy, Reliability, and ROI

Voice AI KPI Scorecard: CSAT/NPS, FCR & Containment, Time‑to‑First‑Word & p95 Latency, Intent/Slot Accuracy & ASR WER, Groundedness, Tool Success (Payments/IDV/Scheduling), Warm Xfers, Uptime/Reliability, Consent/Redact, Cost per Resolution & ROI

Read Article
Sensitive Data in Voice AI: PCI‑Safe Payments, HIPAA‑Compliant PHI, Redaction & Tokenization

Sensitive Data in Voice AI: PCI‑Safe Payments, HIPAA‑Compliant PHI, Redaction & Tokenization

Managing Sensitive Data in Voice AI: PCI‑Safe Payments (DTMF Masking, Tokenization), HIPAA‑Compliant PHI Segregation, Redaction/De‑Identification, End‑to‑End Encryption, Zero‑Trust Access, Residency/Retention, DSAR Deletion, SIEM‑Audited Trails

Read Article

SUBSCRIBE TO OUR NEWSLETTER

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