You need to enable the message receipt permission in AppGallery Connect. For details, please refer to Enabling the Receipt Permission.
The receipt API versions include V1 and V2. The request header and response parameters are the same for receipt messages of different API versions. The only difference lies in the request body. Scenario-specific message push supports only the V2 version.
| Protocol | Direction | URL | Data Format |
|---|---|---|---|
| HTTPS POST | Push Kit server -> Your server for receiving receipts | Address of your server for receiving receipts, which is the same as that defined in AppGallery Connect. | Request: Content-Type: application/json Response: Content-Type: application/json |
| 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 key have been set in the receipt configuration. | timestamp=1563*****1261; nonce=a07bfa17-6d82-4b53-a9a2-07c*****eef1; value=E4Ye*****HZ6592U8B9S37238E+Hwtjfrmpf8AQXF+c= · timestamp: milliseconds-level timestamp. · nonce: random UUID. · value: Base64-encoded string that has been HMAC-SHA256 encrypted using the callback key. The string before encryption consists of timestamp, nonce, and callback user name, without plus signs (+). For details, please refer to the sample code. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| token | Yes | String | Token of the user to which a message is sent. The token is sent to your app server. |
| pushType | Yes | Integer | Message type. For details, please refer to push-type. |
| appPackageName | Yes | String | App package name of the message sender. |
| biTag | No | String | The value is the same as that of biTag contained in the message you send. If biTag is not set for the delivered message, this parameter is empty. |
| requestId | Yes | String | Request ID, which is returned by the message sending API. |
| deliveryStatus | No | deliveryStatus Object | Message delivery status (deliveryStatus). This parameter is applicable to receipts for messages other than widget update messages. |
| formStatus | No | formStatus Object | Delivery status of a widget update message (formStatus). This parameter is applicable only to receipts for widget update messages. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| result | Yes | Integer | Receipt status code for message delivery. For details, please refer to Receipt Status Codes. |
| timestamp | Yes | Long | Millisecond-level timestamp when the message successfully arrives at the client. If the message fails to arrive at the client, the value of this parameter is the timestamp when the receipt message is generated. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| formId | Yes | Long | Instance ID of a service widget, which is obtained when onAddForm is called (when a user adds the widget to the home screen). The maximum value is 231-1. |
| result | Yes | Integer | Receipt status code for message delivery. For details, please refer to Receipt Status Codes. |
| timestamp | Yes | Long | Millisecond-level timestamp when the message successfully arrives at the client. If the message fails to arrive at the client, the value of this parameter is the timestamp when the receipt message is generated. |
{
"statuses": [
{
"biTag": "131415",
"pushType": 0,
"appPackageName": "com.****",
"token": "148896*******000001",
"requestId": "1*******0",
"deliveryStatus":{
"result": 0,
"timestamp": 1607832761768
}
}
]
}