Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
To ensure network security, Push Kit disabled the TLS 1.0 and TLS 1.1 protocols and unsupported cipher suites for push-related domains on February 28, 2023. After the date, your app is unable to send push messages using the TLS protocol earlier than version 1.2 or unspecified cipher suites.
If your app uses TLS 1.0 or TLS 1.1 to access push-related domains, ensure that the protocol is updated to TLS 1.2 or later.
For details, please refer to Notice on Disabling the TLS 1.0 and TLS 1.1 Protocols for Push Kit Domains. If you have any questions, contact our technical support for help.
This API is used by the Push Kit server to send receipts to your server.
You need to enable the message receipt function in AppGallery Connect. For details about how to enable the function, please refer to Preparations.
Protocol | HTTPS POST |
|---|---|
Direction | Push Kit server -> Your server for receiving receipts |
URL | URL of your server for receiving receipts, which you defined and is the same as the callback address in AppGallery Connect. |
Data Format | Request: Content-Type: application/json Response: Content-Type: application/json |
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.
The downlink message APIs for the V1 version are as follows:
https://push-api.cloud.huawei.com/v1/[clientid]/messages:send
https://push-api.cloud.huawei.com/v2/[projectid]/messages:send
The V2 version supports the above APIs and new APIs added subsequently. You are advised to switch to the V2 version by following instructions here.
Request 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 key have been set in the receipt configuration. | timestamp=1563105451261; nonce=a07bfa17-6d82-4b53-a9a2-07cfef5ceef1; value=E4YeOsnMtHZ6592U8B9S37238E+Hwtjfrmpf8AQXF+c=
|
Request Body
Parameter | Mandatory (M)/Optional (O) | Type | Description |
|---|---|---|---|
statuses | M | Array [statuses Object ] | Receipt message content, which is an array of up to 100 statuses structures. This parameter is different for V1 and V2. |
statuses for V1
Parameter | Mandatory (M)/Optional (O) | Type | Description |
|---|---|---|---|
token | M | String | Token of the user to which a message is sent. The token is sent to your server. |
biTag | M | String | The value is the same as that of biTag contained in the message you send. If bi_tag is not set for sending a notification message, biTag is left empty. |
status | M | Integer | Returned receipt status code. For details, please refer to the receipt status codes. |
timestamp | M | Long | Standard Unix timestamp when a message arrives at the device. |
clientId | M | String | App client ID or project ID returned based on the receipt configuration. NOTE
|
projectid | M | String | |
requestId | M | String | Request ID, which is returned by the downlink message sending API. |
subStatus | O | Integer | Sub-status code that explains why the message sending is controlled. The options are as follows:
|
statuses for V2
Parameter | Mandatory (M)/Optional (O) | Type | Description |
|---|---|---|---|
token | M | String | Token of the user to which a message is sent. The token is sent to your server. |
appPackageName | M | String | App package name of the message sender. |
biTag | M | String | biTag contained in the message you send. If bi_tag is not set for sending a notification message, biTag is left empty. |
requestId | M | String | Request ID, which is returned by the downlink message sending API. |
deliveryStatus | O | deliveryStatus Object | Message delivery status (deliveryStatus). |
deliveryStatus
Parameter | Mandatory (M)/Optional (O) | Type | Description |
|---|---|---|---|
result | M | Integer | Receipt status code indicating the message delivery status. For details, please refer to the receipt status codes. |
timestamp | M | Long | Standard Unix 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. |
V1
- {
- "statuses": [
- {
- "biTag": "131415",
- "clientId": "132****013",
- "token": "148896*******000001",
- "status": 0,
- "timestamp": 1489993883189,
- "requestId": "1*******0"
- },
- {
- "biTag": "131415",
- "projectid": "60*******13",
- "token": "14889646*******13000001",
- "status": 2,
- "timestamp": 1489993888189,
- "requestId": "1*******890"
- }
- ]
- }
V2
- {
- "statuses": [
- {
- "biTag": "131415",
- "appPackageName": "com.****",
- "token": "148896*******000001",
- "requestId": "1*******0",
- "deliveryStatus":{
- "result": 0,
- "timestamp": 1607832761768
- }
- }
- ]
- }
Response Body
Parameter | Mandatory (M)/Optional (O) | Type | Description |
|---|---|---|---|
code | M | String | Processing result code returned by your server. |
message | M | String | Description of the processing result code returned by your server. |
- {
- "code": "0",
- "message": "success"
- }