A laptop and gold API key connected to a smartphone receiving a message.

Prepare the account before the request

Generate an API token from API tokens in the dashboard; every request to the SMS gateway Sri Lanka API carries one. You also need an approved sender name and enough credits for the message you want to send (bulk SMS rates).

Keep the token in your server configuration. Do not embed it in a public web page or a client-side application bundle. If a token is no longer needed, revoke it in the dashboard.

Check a message without sending it

The estimate endpoint, POST /api/v3/sms/estimate, accepts a message and a recipient value. It reports the encoding, segment count, valid and invalid recipients, and credits required without sending an SMS.

Use the same text and numbers for the estimate that you intend to send. This is especially useful when an order reference, personalisation or non-Latin text can change the segment count.

Send JSON from your server

Send a POST request to /api/v3/sms/send on your portal domain, the send endpoint of the SMS gateway API. Include the Bearer token, an approved sender_id, the recipient and the message. Use your own phone number for the first test.

The recipient can be one Sri Lankan number or a comma-separated list. The example below is a request body; add the Authorization, Content-Type: application/json and Accept: application/json headers in your HTTP client.

{
  "recipient": "94710000000",
  "sender_id": "YourBrand",
  "message": "Your order is out for delivery."
}

Keep the result and read the receipt

A successful send response includes a message uid, the segment count and credits taken. Keep the returned ID with the event in your own application so you can find that message again; the POS integration guide shows this end to end.

Use GET /api/v3/sms/{uid} to look up a message by ID. A queued response describes the sending state at that moment; delivery status is reported separately once the network confirms it.

Check the documented HTTP response when a request fails. A 402 indicates insufficient credits, a 422 describes invalid input and a 429 indicates that the API rate limit was reached. The Developers page contains the complete endpoint reference and examples.