[Huawei Developers] Mike-mei:
HMS Core Push Kit allows developers to access the Push Kit server using the HTTPS protocol and send downlink messages to devices. This article introduces some common error codes returned when the Push Kit server sends messages, and analyzes the root causes and provides solutions for them.

Error Code 1: 80200001, "OAuth authentication error."

Cause Analysis:

1. The message does not contain the Authorization parameter, or the parameter is left empty.

View attachment 5722101

2. The access token applied for using the ID of app A is used to send messages to app B.

View attachment 5722103

App ID used to apply for the token

View attachment 5722105

View attachment 5722107

App ID used to send messages

Solution:

1. Verify that the HTTP request header contains the Authorization parameter. You can click here to learn about how to obtain the Authorization parameter, and click here to learn more about the API for sending downlink messages.

2. Verify that the app ID used to apply for the access token is the same as that used to send downlink messages.

Error Code 2: 80300007, "Invalid token."

Cause Analysis:

1. The token contains extra characters or is missing characters. For example, the token in the figure below contains an extra space.

View attachment 5722123

2. The token of app B is used to send messages to app A.

View attachment 5722125

Solution:

1. Verify that the token parameter is correctly set.

2. Verify that the token used to send messages belongs to the target app.

Error Code 3: 80300010, "The number of tokens in the message body exceeds the default value."

Cause Analysis:

1. The message parameter is misspelled. For example, the message field is misspelled as messager in the figure below.

2. The position of the token parameter is incorrect, or the parameter structure is incorrect.

3. The number of delivered tokens exceeds the upper limit, or the token is empty.

View attachment 5722127

Solution:

1. Verify that the message and token parameters are correct.

2. Verify that the message parameter contains the token parameter and the token parameter is at the same level as "android".

View attachment 5722131

3. Verify that the number of tokens ranges from 1 to 1000. You can click here to learn about the parameter structure and description.

Error Code 4: 80200003, "OAuth token expired."

Cause Analysis:

1. The access token in the Authorization parameter has expired.

2. The request parameter value is incorrect because it contains extra characters or is missing characters.

View attachment 5722133

Solution:

1. Apply for a new access token to send messages if the existing access token has expired. The access token is valid for one hour. You can click here to learn how to apply for an access token.

2. Verify that the used access token is the same as the obtained one. If the copied access token contains escape characters \/, you need to restore the characters to /.

View attachment 5722135

Error Code 5: sub_error":57303,"error_description":"appid is overload blocked","error":1302

Cause Analysis:

Flow control is triggered because access tokens are requested too frequently. The threshold for triggering access token flow control is 1000 access tokens per 5 minutes.

View attachment 5722137

Solution:

Modify the logic for requesting an access token. The access token is valid for 1 hour so you do not need to apply for it more than once in an hour. The flow control will be canceled after 5 minutes. You can click here to learn more about relevant access token restrictions.

References

HMS Core Push Kit official website

HMS Core Push Kit development guide