目录

Sending Uplink Messages

Function

This API is used by the Push Kit server to send uplink messages to your server through HTTPS.

Scenario

None.

Restrictions

None.

Prototype

Protocol

HTTPS POST

Direction

Push Kit server -> Your server

URL

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

Data Format

Request: Content-Type: application/json

Response: Content-Type: application/json

Request Parameters

Request Header

Parameter

Description

Example

X-HW-SIGNATURE

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

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

  • timestamp: standard UNIX timestamp
  • nonce: colon
  • value: character string to be encrypted

(timestamp + nonce + Uplink message content): obtained after the encryption using the set password in HMAC-SHA256 algorithm and encoding in Base64.

X-HW-TIMESTAMP

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

1563105451261

Request Body

Parameter

Mandatory (M)/Optional (O)

Type

Description

from

M

String

Token of the app that sends uplink messages.

category

M

String

Package name of the app that sends uplink messages.

message_id

M

String

Unique ID generated by the app for a message.

data

O

String

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

Request Example

None.

Response Parameters

Response Body

Parameter

Type

Description

errno

String

Processing result code returned by your server.

errmsg

String

Processing result description returned by your server.

Response Example

None.