Skip to content
OmniChannels.ai

APIs and SMPP

How do I add SMS sending to my app with an API?

Updated

Short answer

To add SMS sending to an app, call the provider's SMS API from your backend with an access token, the recipient's number in international format, an approved sender ID and the message text. Store the returned message ID, receive delivery statuses on a webhook, and handle errors, retries and rate limits before going live.

Steps to integrate

  1. Get test credentials and register the test numbers you will send to.
  2. Store the API token in a secrets manager or environment variable on your server, never in a mobile app or browser code.
  3. Store numbers in E.164 format and convert them to the format the API expects.
  4. Pick the encoding: GSM-7 text, or Unicode for Arabic, emoji and other scripts.
  5. Send the message and save the returned message ID next to your own record.
  6. Set up a webhook to receive delivery statuses.
  7. Add retries with backoff for 429 and 5xx responses, and register sender IDs for each country that requires them.

Mistakes to avoid

  • Calling the API from the client app, which exposes the token to anyone.
  • Sending numbers with a plus sign, spaces or a national leading zero when the API expects digits only.
  • Letting one curly quote or emoji switch the whole message to Unicode, which cuts the characters per segment.
  • Retrying blindly after a timeout. If the API has no idempotency key, record each send first and check its status before resending.
  • Ignoring 429 responses instead of waiting for the Retry-After header.

Example: a single SMS request

On OmniChannels.ai you send one SMS with POST https://api.broadnet.me/sms/sendSms, an Authorization: Bearer header and a JSON body. A successful call returns 200 with the message ID as plain text. Test access is issued after a short request and goes to your own verified numbers; there is no instant self-serve signup.

FieldExampleNote
senderIdOmniDemoYour approved sender ID
destinationNumber447700900123Country code plus number, digits only
messageYour code is 482913The text
messageTypeTEXTTEXT for GSM-7, UNICODE for Arabic and emoji

Official sources