Callback API
Push the SMS receipt status report to the customer's designated address through HTTP batch push.
Protocol Description
Type | Description |
---|---|
URL | HTTP callback address |
Method | POST |
Protocol | HTTP + JSON |
Coding | UTF-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 name | Type | Description | Case | Required |
---|---|---|---|---|
MsgType | int | Push message type, where "2" represents "receipt status report" | 2 | Y |
Data | Array | Batch list | Y |
- Data
Parameter name | Type | Description | Case | Required |
---|---|---|---|---|
SessionNo | string | SMS send sequence number | xddd-xx-ss-ss-ss | Y |
Phone | string | Phone number | 8618512345678 | Y |
CostCount | int | SMS segmentation count | 2 | Y |
ReceiptTime | int | Status report time | 1563867000 | Y |
ReceiptResult | string | Receipt 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 report | Success | Y |
ReceiptCode | string | Status report code | Delivrd | Y |
ReceiptDesc | string | Status report description | User received successfully | Y |
UserId | string | Custom business identifier ID, a string (length must not exceed 32 characters), does not support special characters such as single quotes, emoticons, etc | uspeedo-usms-001 | N |
Response Description
Response Example
{
"code": 0,
"message": "ok"
}
Response Parameters
code | message | Description |
---|---|---|
0 | ok | Received successfully |
Others | Error message | Received 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.