目录

Querying the Topic Subscription List

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.

Function

This API is used to query the list of topics that have been subscribed to for a token.

Restrictions

Currently, this API only supports Android apps.

Prototype

Protocol

HTTPS POST

Direction

Your server -> Push Kit server

URL

https://push-api.cloud.huawei.com/v1/[clientid]/topic:list

NOTE:

In the URL, [clientid] indicates the OAuth 2.0 client ID (credential). To obtain the client ID, sign in to AppGallery Connect, click My projects, click the desired project, and go to the Project settings page.

Data Format

Request: Content-Type: application/json

Response: Content-Type: application/json

Request Parameters

Request Header

Parameter

Description

Example

Authorization

For details, please refer to Client Credentials.

NOTE:

This parameter value is Bearer followed by a space character and then the value of access_token.

Bearer CF3Xl2XV6jMKZgqYSZFws9IPlgDvxqOfFSmrlmtkTRupbU2VklvhX9kC9JCnKVSDX2VrDgAPuzvNm3WccUIaDg==

Request Body

Parameter

Mandatory (M)/Optional (O)

Type

Description

token

M

String

Token whose subscription list is to be queried.

Request Example

{
    "token": "pushtoken1"
}

Response Parameters

Response Body

Parameter

Type

Description

code

String

Result code.

msg

String

Result code description.

requestId

String

Request ID.

topics

Array [Object]

Topics that have been subscribed to.

  • name: name of the subscribed topic.
  • addDate: date when the topic is subscribed to.

Response Example

{
    "msg": "success",
    "code": "80000000",
    "requestId": "1574*******0701",
    "topics": [
        {
            "name": "sports",
            "addDate": "2019-11-25"
        }
    ]
}

Result Codes

HTTP Status Code

Description

Solution

200

Success.

N/A

400

Incorrect parameter.

Rectify the fault based on the status code description.

401

Authentication failed.

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

404

Service not found.

Verify that the request URI is correct.

500

Internal service error.

Go to Support > Customer Service > Submit ticket online, select the relevant category, and submit your ticket. Technical support personnel will get back to you as soon as possible.

502

The connection request is abnormal, generally because the network is unstable.

Try again later or contact technical support.

503

Traffic control.

  1. Set the average push speed to a value smaller than the QPS quota provided by Huawei. For details about the QPS quota, please refer to FAQs.
  2. Set the average push interval. Do not push messages too frequently in a period of time.

Service Result Code

Description

Solution

80000000

Success.

N/A

80100001

Incorrect parameter.

Verify the request parameters as prompted in the response.

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. Obtain a new access token.

80400005

Not data processing location selected.

Set a correct data processing location for your app. For details, please refer to Managing the Default Data Processing Location.

80400006

The data processing location is inconsistent with the actual one.

Contact technical support.

80400007

You do not have permission to save user data.

Enable the precise messaging function for your project.

82000011

The token is left empty.

Check for the token.

82000012

The token is invalid.

Check for the token.