This article describes a callback method for sending information about changes in message processing and delivery status. A callback is a request for information about message status changes that we send to your server. The request parameters are passed in the request body.
Connection URL
To retrieve message callback statuses, during registration, you should specify your system’s API endpoint that will process incoming POST requests from API edna.
Example of the body of an incoming POST request:
{ "requestId": "test-00135", "cascadeId": 11, "cascadeStageUUID": "001-test001", "subject": "test_subject", "subjectId": 2, "status": "READ", "statusAt": "2023-10-31T11:07:56Z", "error": null, "comment": null, "paymentData": { "@type": "WhatsAppConversationPaymentData", "conversationId": "test0001", "conversationType": "marketing", "chargeable": true, "type": "WHATSAPP_CONVERSATION" } }
Request Format
Parameter | Data type | Description |
requestId | string | The request ID from which the message is generated and sent. |
cascadeId | long | The cascade ID. |
cascadeStageUUID | string | Null or data. |
subject | string | The subject name. |
subjectId | long | The subject ID. To retrieve the ID, use the channel-profile method. |
status | string | The message status. |
statusAt | string | The last time the status was updated, displayed in the ISO 8601 format. For example, 2021-01-21T08:00:00Z . |
error | string (optional) | Possible values: null or data. An error occurred while delivering the message. |
comment | string (optional) | The text comment used when the message was sent. It is displayed in the detailed message report. Can be used for chatbot routing. |
paymentData | object | A set of parameters for the WhatsApp channel that sends information about the conversation. |
conversationId | string | The conversation ID. Sent for the WhatsApp channel. |
conversationType | string | The conversation category. Sent for the WhatsApp channel. |
chargeable | boolean (optional) | The conversation type: paid or free. Sent for the WhatsApp channel for the delivered and read statuses. |
Response Format
In response to a request from your server, the status of its execution should be returned with the code 200
.
If the code 200
is not received in response to the callback request, edna Pulse makes 10 more request attempts with an interval of 2*X seconds between attempts (where X is the number of attempts) until the code 200
is received in response. That is, every 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 seconds.
Delivery Statuses
Status | Description |
sent | The message has been sent to the recipient. |
delivered | The message has been delivered to the recipient. |
read | The message has been read by the recipient. |
undelivered | The message has been sent but not delivered to the recipient. |
cancelled | Sending the message has been canceled. |
expired | The message didn’t receive the delivered status because:• the time specified when configuring the cascade is expired; • the default message delivery time (TTL) of the channel is expired (see more about the message delivery time). |
failed | Error processing the message. |