Skip to content
OmniChannels.ai

APIs and developers

What is REST API?

RESTful API · HTTP API · JSON API

Definition

A REST API is a web interface that exposes resources, such as messages, contacts or templates, at URLs and lets programs create, read, update and delete them with standard HTTP methods (POST, GET, PATCH, DELETE), usually exchanging JSON.

A REST API lets one program control another over the web. Resources such as messages, contacts and templates are identified by URLs, and the client uses standard HTTP methods to work on them: GET to read, POST to create, PATCH or PUT to update and DELETE to remove. Data is exchanged as JSON, which is readable by people and easy to parse in every language.

REST (representational state transfer) is an architectural style described by Roy Fielding in his 2000 dissertation. The HTTP semantics it relies on are standardised in RFC 9110. In messaging terms, sending a text means making an authenticated HTTPS request, for example a POST with a JSON body containing the recipient, sender and text, and receiving a JSON response with a message ID and an initial status.

HTTP status codes tell the client what happened. A 2xx code means success, 4xx means the request was wrong, such as an invalid number, missing authorisation or exceeded limit, and 5xx means a server problem. Read the error body as well as the status code, since it usually names the field that failed. Do not retry 4xx errors blindly, but do retry 5xx and network errors with backoff.

Several patterns recur. Bearer-token authentication puts a secret token in the Authorization header. Idempotency keys let a client retry a request without creating a duplicate message. Pagination handles long lists, rate limits protect the service and are signalled in responses, and webhooks deliver asynchronous results such as delivery reports, replies and status changes to a URL you control.

Webhooks are the other half of messaging integrations. A send request returns quickly with an ID, while the real outcome, such as delivered or failed, arrives later. Your endpoint should respond fast, verify the call, process it idempotently, because duplicates can happen, and then reconcile statuses with the message ID.

For very high volumes of SMS, carriers and aggregators often use SMPP, a binary protocol that keeps a persistent connection open and sends many messages at once. REST is easier to build, test and secure, and suits most CRMs, e-commerce platforms and back-office systems. The two can be used together.

An OpenAPI specification describes endpoints, parameters and responses in a machine-readable file. From it, teams generate client SDKs, documentation, test data and mock servers, which cuts integration time and errors. Keep secrets out of client-side code, store tokens in a secrets manager and rotate them if exposed.

OmniChannels.ai provides a REST/JSON API at https://api.broadnet.me, authenticated with Authorization: Bearer tokens issued per account. It documents about 330 paths covering SMS, WhatsApp, RCS, Messenger, Instagram, Telegram, Email and Push, with an OpenAPI 3.1 specification, a TypeScript SDK (@broadnet/cpaas-sdk) and webhooks for delivery statuses. Test access goes to your own verified numbers.

Example

POST https://api.broadnet.me/… with header "Authorization: Bearer <token>" and a JSON body; the response returns a message ID.

Frequently asked questions

What is the difference between REST and SMPP?

REST is request-and-response over HTTPS, easy to build and widely supported. SMPP is a binary protocol with persistent connections, often used for high-volume SMS between aggregators and carriers. Choose by volume and the skills of your team.

Is a REST API the same as a webhook?

No. With a REST API your system calls the platform. With a webhook, the platform calls your system when something happens, such as a delivery update or a reply.

Do I need an SDK to use a REST API?

No. You can call it from any language that can make HTTPS requests. An SDK just wraps the calls and types for convenience.

How do I avoid sending duplicate messages when I retry?

Use idempotency keys if the API supports them, or check message status by ID before retrying. Retrying a timed-out send without such a check can duplicate messages.

Sources