How to read a worked sample
Every endpoint guide in these docs ships a worked sample — a request you can copy verbatim, and the exact response envelope the platform returns. This index shows you how to turn a sample into a running call, and where the rest of the worked examples live.Reading an endpoint’s sample
A worked sample is a complete request: method, path, headers, and body. Nothing in it is a placeholder except your API key — so translating the curl block to your language is mechanical.- Copy the request as written. Base URL is always
https://api.orbit.devotel.io/api/v1; substitute a Test key (dv_test_sk_…) forX-API-Keyand the sample runs against the sandbox. - Translate it per language. The headers and JSON body carry over unchanged — only the HTTP client differs.
cURL
fetch
orbit.messages.send({ channel: "sms", to, body }) — and returns the same data the raw response carries. Pick whichever you read faster; the envelope below is identical either way.
The four envelope shapes
Every response the platform returns is one of four shapes. Recognize the shape at a glance and you know how to read the body:- Success envelope —
{ data, meta }, HTTP 2xx. The resource (or a resource id) sits underdata;metacarries the request correlation id: - Success with pagination — the same
{ data, meta }, withmeta.paginationtelling you how to fetch the next page: - 207 Multi-Status batch envelope — bulk endpoints answer
207on partial success and give you one row per recipient; branch onstatusper row, never blanket-retry the batch:Canonical sample: Bulk sends (207 and all) and the Verify API. - Error envelope —
{ error, meta }on any non-2xx status. Branch on the stableerror.code, never on the human-readableerror.message:Canonical sample: API error handling by example.
Where the worked examples live
Samples are spread across the docs deliberately — each sits next to the endpoint it exercises. This page is the index:- REST API recipes — sixteen task-by-task worked samples (messaging, voice, campaigns, CDP, webhook round trips), each pairing curl with Node or Python.
- Error handling by example — three worked failures with the fix in code.
- Endpoint worked samples — each endpoint family page carries a curated sample block (messaging, campaigns, voice, and the rest).
- Starter examples and the Quickstart — five runnable repos and the end-to-end first call, when a single request/response isn’t enough.
Pagination in one paragraph
List endpoints paginate one of two ways, and the response tells you which: most endpoints are cursor-based — readmeta.pagination.cursor when has_more is true and pass it back as ?cursor=…; a smaller set of dashboard-oriented families is offset-based — the page metadata (items, total, limit, offset) lives inside the data envelope instead. The shape of the response you’re holding identifies the style. The full contract, with both loops in code: Pagination.