Skip to main content

Callback API

Push the SMS receipt status report to the customer's designated address through HTTP batch push.

Protocol Description

TypeDescription
URLHTTP callback address
MethodPOST
ProtocolHTTP + JSON
CodingUTF-8

Request Description

The request is for a JSON Array format, a single request may contain multiple SMS receipt status reports.

Request Example

{
"MsgType": 2,
"Data": [
{
"SessionNo": "d0****f7-0fc3-****-****-9f73****6c6e",
"Phone": "86185****9057",
"CostCount": 2,
"ReceiptTime": 1563867000,
"ReceiptResult": "Success",
"ReceiptCode": "Delivrd",
"ReceiptDesc": "Success",
"UserId": "you man c define the content by yrself"
},
{
"SessionNo": "d1****f7-0fc3-****-****-9f73****6c6e",
"Phone": "86185****9057",
"CostCount": 2,
"ReceiptTime": 1563867000,
"ReceiptResult": "Fail",
"ReceiptCode": "MSBLACK",
"ReceiptDesc": "Anti-harassment blacklist.",
"UserId": "you man c define the content by yrself"
} ]
}

Request Parameters

Parameter nameTypeDescriptionCaseRequired
MsgTypeintPush message type, where "2" represents "receipt status report"2Y
DataArrayBatch listY
  • Data
Parameter nameTypeDescriptionCaseRequired
SessionNostringSMS send sequence numberxddd-xx-ss-ss-ssY
PhonestringPhone number8618512345678Y
CostCountintSMS segmentation count2Y
ReceiptTimeintStatus report time1563867000Y
ReceiptResultstringReceipt status result, which can be used to determine the sending result based on this field, with enum values: Success: indicates that the short message is sent successfully, Fail: indicates that the short message failed to send, UNKNOWN: indicates that the carrier has not reported the status reportSuccessY
ReceiptCodestringStatus report codeDelivrdY
ReceiptDescstringStatus report descriptionUser received successfullyY
UserIdstringCustom business identifier ID, a string (length must not exceed 32 characters), does not support special characters such as single quotes, emoticons, etcuspeedo-usms-001N

Response Description

Response Example

{
"code": 0,
"message": "ok"
}

Response Parameters

codemessageDescription
0okReceived successfully
OthersError messageReceived failed

Resend Explanation

After the first push fails (not a successful response), it will be resent every 1 second, and if it still fails after a total of 3 retries, the pushing will be stopped.