目录

1. API Information

Function: This API is used to query all information related to a token.

Restrictions: none

2. Prototype

Protocol

HTTPS POST

Direction

App server -> HUAWEI Push Kit server

URL

https://push-api.cloud.huawei.com/v1/[appid]/token:query

3. Parameters

Request Parameters (HTTP Header)

Parameter

Description

Example

Authorization

For details, please refer to Open Platform Authentication - Client Password Mode.

Notice: A space character must be added between Bearer and the value of access_token.

Bearer CF3Xl2XV6jMKZgqYSZFws9IPlgDvxqOfFSmrlmtkTRupbU2VklvhX9kC9JCnKVSDX2VrDgAPuzvNm3WccUIaDg==

 

Request Parameters (HTTP Body)

Parameter

Type

Mandatory (M)/Optional (O)

Description

token

string

M

Push token of a user.

 

Response Parameters

Parameter

Type

Description

code

string

Result code.

msg

string

Result code description.

requestId

string

Request ID.

aaId

string

AAID.

groupKeys

array

Keys of device groups that a device joins.

topics

array

Topics that have been subscribed to.

 

Sample request code:

  1. {
  2.    "token": "pushtoken1"  
  3. }

Sample response code:

  1. {
  2.    "msg": "success",
  3.    "code": "80000000",
  4.    "groupKeys": [
  5.        "REdfxiTJSKIyP8Qqs4yI729IS_F37sn7yPl-MbpxczWi3DE"
  6.    ],
  7.    "aaId": "",
  8.    "requestId": "157466778435100047000701",
  9.    "topics": [
  10.        "sports"
  11.    ]
  12. }

4. API Result Codes

HTTP Status Code

Description

Solution

200

OK

N/A

400

Incorrect parameter.

Check the status code in the response and rectify the fault based on the status code.

401

Authentication failed.

Check the access token in the Authorization parameter in the request HTTP header.

404

Service not found.

Check whether the request URL is correct.

500

Internal service error.

Contact Huawei technical support.

 

Service Result Code

Description

Solution

80000000

Success.

N/A

80200001

OAuth authentication error.

The access token in the Authorization parameter in the request HTTP header failed to be authenticated. Ensure that the access token is correct.

80200003

OAuth token expired.

The access token in the Authorization parameter in the   request HTTP header expired. Apply for a new access token.

80400005

Not data storage location selected.

Select a data storage location for the app in AppGallery Connect.

80400006

The data storage location is inconsistent with the actual one.

Contact Huawei technical support.

82000011

The token parameter is left empty.

Check the token parameter.