SMS & WhatsApp Messaging

Get message status

get/messages/{id}

Request

  • Base URL: https://api.envoisms.ma/v1
  • URL: https://api.envoisms.ma/v1/messages/{id}
  • Auth: HTTP bearer

Path parameters

idstring required

Response

Message details

idstring
campaign_idstring nullable
tostring
channel'sms' | 'whatsapp' | 'telegram' | 'voice' | 'rcs'
bodystring
sender_idstring
unicodeinteger

1 when the body required the UCS-2 alphabet (Arabic etc.), 0 for GSM-7

segmentsinteger
status'queued' | 'sent' | 'delivered' | 'failed' | 'undeliverable' | 'unconfirmed'

unconfirmed = the network accepted the message but never reported a final outcome within the reporting window; a delivery receipt arriving later still replaces it.

error_codestring nullable

Set on failed/undeliverable messages. A short diagnostic key: DLR_<network status> when the failure came from a delivery report (e.g. DLR_REJECTD, DLR_EXPIRED, DLR_UNDELIV), GATEWAY_* for a failure on the EnvoiSMS routing side before the network was reached, ENVOISMS_* for other routing diagnostics, META_* for a WhatsApp refusal (see "WhatsApp failure codes" in the API description). Treat unknown values as a generic terminal failure — new keys may appear.

error_messagestring nullable

Human-readable failure reason in English, set together with error_code. When the network gave no reason, this reads "The destination network did not deliver this message and gave no reason." Display text — do not parse it programmatically; branch on status and error_code instead.

cost_eurnumber
cost_madnumber
scheduled_atstring date-time nullable
sent_atstring date-time nullable
delivered_atstring date-time nullable
read_atstring date-time nullable

Timestamp when the recipient opened and read the message (WhatsApp blue checkmark)

failed_atstring date-time nullable
operatorstring nullable

Resolved destination network for Moroccan numbers (Maroc Telecom, Orange, Inwi, Autre); best-effort elsewhere.

sandboxinteger

1 when the message was created by an env_test_ sandbox key

created_atstring date-time

Example response

{
  "id": "msg_8f2da1b2c3d4e5f6a7b8c9d0",
  "to": "+212612345678",
  "body": "Votre code est 1234",
  "sender_id": "MonApp",
  "segments": 1,
  "cost_eur": 0.072,
  "cost_mad": 0.79,
  "operator": "Maroc Telecom"
}

Changes

No recorded changes to this operation across all 1 revision of this API.