# Status Report Push

SMS receipt status reports are pushed to the customer's specified address via HTTP batch push.



## Protocol Explanation

| Category | Description                                  |
| -------- | -------------------------------------------- |
| URL      | User-configured HTTP callback address (currently requires user provision) |
| Method   | POST                                         |
| Protocol | HTTP + JSON                                  |
| Encoding | UTF-8                                        |



## Request Description

The request is formatted as a JSON Array, and a single request may contain multiple SMS receipt status reports.

### Request Example

```json
{
  "MsgType": 2,
  "Data": [
    {
      "SessionNo": "d0****f7-0fc3-****-****-9f73****6c6e",
      "Phone": "185****9057",
      "CostCount": 2,
      "ReceiptTime": 1563867000,
      "ReceiptResult": "Sent successfully",    // Determine the sending result using this field, see parameter description for enumeration values
      "ReceiptCode": "Delivrd",
      "ReceiptDesc": "User received successfully",
      "UserId": "you man c define the content by yrself"  
    },
    {
      "SessionNo": "d1****f7-0fc3-****-****-9f73****6c6e",
      "Phone": "185****9057",
      "CostCount": 2,
      "ReceiptTime": 1563867000,
      "ReceiptResult": "Sending failed",
      "ReceiptCode": "MSBLACK",
      "ReceiptDesc": "Phone in operator's anti-harassment blacklist",
      "UserId": "you man c define the content by yrself"  
    } ]
}
```



### Parameter Description

| Parameter name | Type  | Description                      | Case | Required |
| -------------- | ----- | -------------------------------- | ---- | -------- |
| MsgType        | int   | Type of the push message, 2 represents receipt status report | 2    | Y        |
| Data           | Array | Batch list                        |      | Y        |

- Data

| Parameter name | Type   | Description                                                  | Case             | Required |
| -------------- | ------ | ------------------------------------------------------------ | ---------------- | -------- |
| SessionNo      | string | Sending sequence number of [SMS sending](/docs/api/usms-api/send_usms_message) | xddd-xx-ss-ss-ss | Y        |
| Phone          | string | Mobile number                                                | 18512345678      | Y        |
| CostCount      | int    | Count of split messages                                      | 2                | Y        |
| ReceiptTime    | int    | Time of the status report                                    | 1563867000       | Y        |
| ReceiptResult  | string | Receipt status result; this field can be used to determine the sending result. Enumeration values:<br>> Sent successfully or Success: The short message was sent successfully<br>> Sending failed or Fail: The short message sending failed<br>> Unknown state or Unknow: The carrier did not report the status report | Sent successfully | 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 cannot exceed 32 characters), does not support special characters like single quotes or emojis | xxx-uhost-001 | N        |



## Response Description

### Response Example

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



### Parameter Description

| code | message  | Description |
| ---- | -------- | ----------- |
| 0    | ok       | Received successfully |
| Non-0 | Error description | Not received successfully |



## Retry Explanation

If the initial push fails (non-success response), a retry will occur every 1 second. If it still isn't successful after 3 retries, the push will cease.