目录

1 Prototype

Protocol

HTTPS POST

Direction

HUAWEI Push Kit server -> App server

URL

URL of the app server for receiving uplink messages, which is defined by the developer and is the same as the receiving URL set in AppGallery Connect.

2 Function

This API is used to send uplink messages to the app server through HTTPS.

3 API Parameters

Input Parameters (HTTP Header)

Parameter

Description

Example

X-HW-SIGNATURE

Message header signature, which is mandatory, indicating the signature information sent to the app server that receives uplink messages.

timestamp=1563105451261;nonce=:;value=E4YeOsnMtHZ6592U8B9S37238E+Hwtjfrmpf8AQXF+c=

  • timestamp: UTC timestamp of the system.

  • nonce: colon.

  • value: character string to be encrypted.

(timestamp + nonce + Uplink message content): obtained after the encryption in HMAC-SHA256 mode using a callback key and encoding in Base64.

X-HW-TIMESTAMP

Message header timestamp, which is mandatory, indicating the time when the HUAWEI Push Kit server receives uplink messages.

1563105451261

Input Parameters (HTTP Body)

Parameter

Type

Mandatory (M)/Optional (O)

Description

from

String

M

Token of the app that sends uplink messages.

category

String

M

Package name of the app that sends uplink messages.

message_id

String

M

Unique ID generated by the app for a message.

data

String

O

Valid key-value pairs contained in the message. The parameter value needs to be encrypted using Base64.

Output Parameters

Parameter

Type

Description

errno

String

Processing result code returned by the app server.

errmsg

String

Processing result description returned by the app server.