Delivery report
When a message changes state, Telrioz POSTs a JSON event to the webhook URL you set in Developers โ Webhook. The URL must be https. There is one event type, message.status, with two shapes of data: one for messages sent through the REST API, one for messages sent over SMPP.
When an event comes
| Sent through | Events | data.status |
|---|---|---|
| REST API | A message sent through the REST API, including OTPs, their Fallback sends and Bulk sends from the dashboard: one event when every part is final. | Only final states: delivered, rejected, undelivered, expired, deleted, unknown, not_sent, upstream_rejected |
| SMPP | A message sent over an SMPP bind: one event per part and per state, from sent on. | sent, delivered, rejected, undelivered, expired, deleted, unknown, not_sent, upstream_rejected |
accepted and retrying never come as events. A REST message gets one event, when all its parts are final; its status is the first part that was not delivered, else delivered. An SMPP part usually gets two: sent, then its final state. data.channel says which API the message came in through (api or smpp); it is not the delivery Channel.
For the part-by-part detail of a REST message, call GET /messages/{id} with data.id.
Headers
| Header | Value |
|---|---|
content-type | application/json |
x-telrioz-event-id | The event_id of the body: the same on every retry of one event. |
x-telrioz-timestamp | When this try was signed, in Unix seconds. |
x-telrioz-signature | v1= then the lowercase hex HMAC-SHA256, keyed with your webhook secret, of the timestamp, a dot and the raw body. |
| Your own | Up to 10 headers you set in Developers โ Webhook, such as a token for your server. They cannot use the names above. |
Check x-telrioz-signature before you trust the body: Verify the signature. Answer any 2xx within 5 seconds, or the event comes again: Retries.
REST shape
| Field | Type | Meaning |
|---|---|---|
event_id | string | The event's ID, the same on every retry: keep it to skip repeats. |
type | "message.status" | Always message.status. |
data.id | string (uuid) | The message ID that POST /messages or POST /otp answered. |
data.channel | "api" | Always api for this shape. |
data.status | string | The message's final Delivery state: the first part that was not delivered, else delivered. |
data.to | string | The number. |
data.segments | integer | How many parts the message has. |
SMPP shape
| Field | Type | Meaning |
|---|---|---|
event_id | string | The event's ID, the same on every retry: keep it to skip repeats. |
type | "message.status" | Always message.status. |
data.id | string | The part's message_id, as submit_sm_resp gave it. |
data.channel | "smpp" | Always smpp for this shape. |
data.status | string | The part's Delivery state. |
data.from | string or null | The source_addr you sent. |
data.to | string | The number. |
data.part | integer or null | The part number, from 1; null for a one-part message. |
data.parts | integer or null | How many parts the message has; null for a one-part message. |
data.multipart_id | string or null | For a long message, the same on every part (the message_id of its first part seen); null for a one-part message. |
data.error | string or null | The error code from the receipt, or the upstream's answer when it refused the part; null when there is none. |
data.done_at | string or null (date-time) | When the receipt came, or else when the upstream answered (ISO 8601). |
A long SMPP message gives one event per part. Group them by multipart_id, and use part and parts to know when you have them all. The example on the right is a two-part message whose parts were both delivered. The meaning of an error code, such as ESME_RINVDSTADR, is in the message errors. An upstream carrier may send a code that is not listed there.