Working examples you can copy. Each one sends an SMS, waits and tries again when the API answers 429,
and checks status in the answer, because HTTP 200 can still be a refusal.Keep the API key in an environment variable or a secret store, never in the source code.Send an SMS#
Receive a delivery report#
Give the address of this receiver as callback_url when you send. Answer HTTP 200 after a valid report has
been recorded; any other answer, including 204, makes us send the report again. Use
(message_id, SMSID, DLRStatus) to recognise a repeated state. Do not deduplicate by the two IDs alone:
an Accepted report and a later Delivered report for the same SMS are different states and both matter.
Reports can arrive out of order; these examples record distinct states, not an authoritative latest status.
Use the status lookup when the result drives a business decision. See Delivery reports
for every field and the lookup call.The examples accept JSON objects up to 64 KiB. They require a positive integer message_id, non-empty
string SMSID and PhoneNumber, and string DLRStatus. An empty status is valid (pending). uid may be
absent or null. Invalid reports return 400; oversized bodies return 413. These are example receiver limits,
not new API limits.Replace the example callback path with your own long random value and serve it over HTTPS. Reports are
not signed; possession of the callback URL is not proof of delivery. Put a production web server or proxy
in front, with request-size limits and timeouts. Do not expose the demonstration HTTP servers directly.
The Python example expects a Content-Length body; configure the proxy to buffer/dechunk incoming requests.Python and Node.js below are single-process, in-memory demonstrations. They remember repeated states
only until restart, and the set grows while they run. Before production, replace the set and print with a
durable database inbox having a unique (message_id, SMSID, DLRStatus) key, acknowledge only after commit,
and process business actions separately. Define retention and cross-worker coordination for that inbox.The PHP example requires PHP 8.1+ with PDO_SQLite. Configure VELOCONNECT_REPORT_DB as an absolute path
such as /var/lib/myapp/delivery-reports.sqlite, in an existing, service-owned private directory outside
the web document root. The PHP service must be able to write there. Route only your secret callback URL to
the script. It creates the table on first use, stores each distinct state across requests and restarts,
and returns 503 if storage is unavailable or the path is unsafe. A worker must consume the stored inbox;
the diagnostic log is not a reliable business-action queue. SQLite storage does not make downstream
actions exactly-once; give those actions their own idempotency and retention rules. Restrict access to
the inbox and logs because they contain customer data.Call with a login token#
Sign in once, keep the token, and send it as a bearer token. See Authentication
for renewing it.Every reference page also shows a ready request in many more languages: open a call and look at the request
sample on the right. Modified at 2026-10-09 08:25:00