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
- Get test credentials and register the test numbers you will send to.
- Store the API token in a secrets manager or environment variable on your server, never in a mobile app or browser code.
- Store numbers in E.164 format and convert them to the format the API expects.
- Pick the encoding: GSM-7 text, or Unicode for Arabic, emoji and other scripts.
- Send the message and save the returned message ID next to your own record.
- Set up a webhook to receive delivery statuses.
- 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.
| Field | Example | Note |
|---|---|---|
| senderId | OmniDemo | Your approved sender ID |
| destinationNumber | 447700900123 | Country code plus number, digits only |
| message | Your code is 482913 | The text |
| messageType | TEXT | TEXT for GSM-7, UNICODE for Arabic and emoji |
