目录

1. API Information

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.

2. Prototype

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.

3. 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.

 

Status Structure

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:

  1. {
  2.    "statuses": [
  3.        {
  4.            "biTag": "131415",
  5.            "appid": "0000000013",
  6.            "token": "14889646529623230000000013000001",
  7.            "status": 0,
  8.            "timestamp": 1489993883189,
  9.            "requestId": "1234567890"
  10.        },
  11.        {
  12.            "biTag": "131415",
  13.            "appid": "0000000013",
  14.            "token": "14889646529623230000000113000001",
  15.            "status": 2,
  16.            "timestamp": 1489993888189,
  17.            "requestId": "1234567890"
  18.        }
  19.    ]
  20. }