Obtains a message receipt by specifying an HTTP URL.
Protocol
Parameter | Description |
Protocol | HTTP + JSON |
Encoding format | UTF-8 |
Request
Multiple message receipts may be pushed to an HTTP server at a time.
In the following sample request, MsgFrameType is set to template.
[
{
"Status":"Failed",
"ErrorDescription":"131026:Receiver is incapable of receiving this message(Message Undeliverable.)",
"MsgFrameType":"template",
"TaskId":"202307030171*******9",
"From":"86131*******8",
"Timestamp":1691043638000,
"OriginPhoneNumber":"86130*******8",
"TemplateCode":"820561547132813184",
"Type":"TEMPLATE",
"Language":"id",
"TemplateName":"wa_otp_v_0_0_3",
"To":"86138*******8",
"ErrorCode":"131026",
"MessageId":"2023078469463703*******3"
},
{
"Status":"Failed",
"ErrorDescription":"131026:Receiver is incapable of receiving this message(Message Undeliverable.)",
"MsgFrameType":"template",
"TaskId":"202307030171*******9",
"From":"86131*******8",
"Timestamp":1691043638000,
"OriginPhoneNumber":"86130*******8",
"TemplateCode":"820561547132813184",
"Type":"TEMPLATE",
"Language":"id",
"TemplateName":"wa_otp_v_0_0_3",
"To":"86137*******8",
"ErrorCode":"131026",
"MessageId":"2023078469463703*******3"
}
]
In the following sample request, MsgFrameType is set to message.
[
{
"Status":"Read",
"MsgFrameType":"message",
"Type":"INTERACTIVE",
"TaskId":"2023068473353098*******8",
"From":"86131*******8",
"To":"86138*******8",
"Timestamp":1691132091000,
"OriginPhoneNumber":"86131*******8",
"MessageId":"2023038470553398*******8",
"ConversationId":"72222201111****",
"ConversationType": "service"
},
{
"Status":"Read",
"MsgFrameType":"message",
"Type":"INTERACTIVE",
"TaskId":"2023068473353098*******8",
"From":"86131*******8",
"To":"86138*******1",
"Timestamp":1691132091000,
"OriginPhoneNumber":"86131*******8",
"MessageId":"2023038470553398*******8",
"ConversationId":"72222201111****",
"ConversationType": "service"
}
]
Request parameters
Parameter | Type | Required | Description |
MessageId | String | Yes | The message ID. |
From | String | Yes | The phone number of the message sender. |
To | String | Yes | The phone number of the message receiver. |
Timestamp | Long | Yes | The time when the message was sent. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
Status | String | Yes | The state of the message. Valid values:
|
StatusDescription | String | Yes | The description of the message state. |
ErrorCode | String | No | The error code. |
ErrorDescription | String | No | The description of the error code. For more information, see Error codes. |
ConversationType | String | No | The conversation type. Valid values:
|
ConversationId | String | No | The conversation ID. |
MsgFrameType | String | Yes | The message type. Valid values:
|
Type | String | No | The type of the media resources that are included in the message. Valid values:
|
TaskId | String | No | The task ID. Default value: MessageId. Note If you do not specify TaskId, the default value MessageId is used. |
OriginPhoneNumber | String | No | The real number of the message sender. |
TemplateCode | String | No | The message template code. Note The value of TemplateCode is automatically generated if MsgFrameType is set to template. |
Response
After your HTTP server receives a delivery receipt, the HTTP status code in the response must be 200, and the response parameters must be in the following format. Otherwise, the system determines that the delivery receipt failed to be pushed and tries to push the delivery receipt again.
Sample response
{
"code" : 0,
"msg" : "Successful"
}
Response parameters
Parameter | Type | Required | Description |
code | Number | Yes | The response code. |
msg | String | No | The description of the response code. |
Retries
After the system fails to push a delivery receipt, it tries to push the delivery receipt again 1 minute later. If this retry fails, the system performs a second retry 5 minutes later. If the system fails to push a delivery receipt for three consecutive times, it no longer retries.