Function: This API is used by the HUAWEI Push Kit server to send receipts to a developer's receipt processing server.
Restrictions: You need to enable the message receipt function in AppGallery Connect. For details about how to enable the function, please refer to Enabling the Message Receipt Function.
Protocol | HTTPS POST |
Direction | HUAWEI Push Kit server -> Developer's receipt processing server |
URL | URL of a developer's receipt processing server, which is defined by the developer and must be the same as that configured in AppGallery Connect. For details about how to configure the URL, please refer to Setting Receipt Parameters. |
Request Parameters (HTTP Header)
Parameter | Description | Example |
X-HUAWEI-CALLBACK-ID | Message header authentication parameter, which is optional. This parameter is mandatory when both the callback user name and callback key are configured in the receipt configuration. | timestamp=1563105451261; nonce=a07bfa17-6d82-4b53-a9a2-07cfef5ceef1; value=E4YeOsnMtHZ6592U8B9S37238E+Hwtjfrmpf8AQXF+c= 1. timestamp: UTC timestamp of the system. 2. nonce: random UUID. 3. value: string finally obtained after the to-be-encrypted string (consisting of the value of timestamp, value of nonce, and callback user name) is encrypted using the set password in HMAC-SHA256 algorithm and then encoded using Base64. |
Request Parameters (HTTP Body)
Parameter | Type | Mandatory (M)/Optional (O) | Description |
statuses | array | M | Receipt content. For details, please refer to the status structure. To improve performance, the sending status of multiple messages can be combined in a receipt. A single receipt can contain the sending status of a maximum of 1000 messages. |
Parameter | Type | Mandatory (M)/Optional (O) | Description |
token | string | M | Token. |
biTag | string | M | The value is the same as that of biTag contained in a developer's request. |
status | integer | M | For details, please refer to Message Receipt. |
timestamp | integer | M | Local timestamp when a message arrives at the device. |
appid | string | M | App ID registered in AppGallery Connect. |
requestId | string | M | Request ID, which is contained in the corresponding response. |
Response Parameters
Parameter | Type | Mandatory (M)/Optional (O) | Description |
errno | string | M | Processing result code returned by an app server. |
errmsg | string | M | Processing result description returned by an app server. |
Sample code:
- {
- "statuses": [
- {
- "biTag": "131415",
- "appid": "0000000013",
- "token": "14889646529623230000000013000001",
- "status": 0,
- "timestamp": 1489993883189,
- "requestId": "1234567890"
- },
- {
- "biTag": "131415",
- "appid": "0000000013",
- "token": "14889646529623230000000113000001",
- "status": 2,
- "timestamp": 1489993888189,
- "requestId": "1234567890"
- }
- ]
- }