目录

Response Parameters

Response Body

Parameter

Type

Description

code

String

Response code.

msg

String

Response message.

requestId

String

Request ID.

Response Examples

Success response example:

{ 
    "code": "80000000", 
    "msg": "Success", 
    "requestId": "157*******006" 
}

Failure response example:

{ 
    "code": "80100003", 
    "msg": "Illegal payload, badge addNum value ranges from 1 to 99", 
    "requestId": "1690*******1701" 
}

Response Codes

[h2]HTTP Response Codes

HTTP Response Code

Description

Solution

400

Invalid parameter.

Check the service response code and locate the fault accordingly.

401

Authentication failed.

Check the Authorization parameter in the HTTP header.

404

Service not found.

Verify that the request URI is correct.

500

Internal service error.

Submit a ticket online for assistance.

502

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

Try again later or submit a ticket online.

503

Traffic control.

  • Distribute the sending speed evenly.
  • Spread out push notification delivery to avoid peak sending times.

[h2]Service Response Codes

Service Response Code

Description

Solution

80000000

Sent successfully.

N/A

80100000

The message failed to be sent to some tokens.

The tokens to which the message failed to be sent are identified in the msg parameter of the response message. Locate the cause of the sending failure, which might be one of the following:

  1. noPushTypeRight: There is no permission to send messages of the specified push-type.
  2. noRight: Push Kit is not enabled.
  3. atomicUnableSendUnsubscribedMsg: The atomic service does not support message sending.
  4. tokenFormatError: The token format is incorrect.
  5. countryNotSupport: The country/region is not supported.
  6. tokenPlatformNotSupport: Third-party proxy tokens are not supported.
  7. disableSendHuaweiMsgBecauseOfPenalty: The app is punished for violations.
  8. differentImgVerifyPolicy: The value of push-type used for image risk control is different from that used in message sending.
  9. appinfoError: The app has not been created. If the app has been created, try again later.

Response example:

{ 
    "code": "80100000", 
    "msg": "{\"illegalTokens\":{\"tokenFormatError\":[\"MAAALgE4G98BAAAAst*******jg\"]},\"success\":1,\"failure\":1}", 
    "requestId": "1690*******1701" 
}

80100001

Some request parameters are invalid.

Verify the request parameters as prompted in the response.

80100003

Incorrect message structure.

Verify the content in the message structure as prompted in the response.

80100004

The message expiration time is earlier than the current time.

Verify the message field ttl.

80100016

The message content failed the verification.

Verify that the specified field does not contain sensitive words as prompted in the response.

80100022

Signature verification is not performed for images in the message.

Verify that images in the message have passed risk check.

80200001

Authentication error.

The Authorization parameter in the request header failed to be authenticated. Check for and rectify the following errors:

  1. The message does not contain the Authorization parameter, or the Authorization parameter is left empty.
  2. The project ID used for JWT application is different from that used for sending the message.
  3. The JWT in the Authorization parameter does not match the app. For details, please refer to Generating a JWT Based on a Service Account.

80200005

JWT expired.

Generate a new JWT and then send the message.

80300002

The current app does not have the permission to send messages.

  1. Sign in to AppGallery Connect and verify that Push Kit has been enabled.
  2. Verify that there are no errors in the body of the message sent.

80300007

All tokens are invalid.

Locate the cause of the sending failure, which might be one of the following:

  1. In principle, the tokens of different apps on the same device are different. However, the same tokens may exist by mistake in practice.
  2. The package name and app ID configured for the app on the device are different from those obtained in AppGallery Connect.
  3. The tokens to which the message failed to be sent are identified in the msg parameter of the response message. For details, please refer to the description of response code 80100000.
  4. Devices are upgraded from HarmonyOS 3.x/4.x (HarmonyOS for short) to HarmonyOS NEXT/5.0.x or later (HarmonyOS NEXT for short). As a result, push tokens need to be re-obtained.

80300008

The message body size (excluding tokens) exceeds the default value (4096 bytes).

Reduce the message body size.

80300010

The number of tokens in the message body exceeds the default value.

Only one token can be carried each time an authorized subscription message or widget update message is sent.

In other scenarios, a maximum of 1000 tokens can be carried each time a message is sent.

Reduce the number of tokens in each message and send messages in batches.

80300029

The test message sending frequency reaches the limit.

Decrease the test message sending frequency.

80300030

The number of tokens contained in a test message exceeds the default value.

Only one token can be carried each time an authorized subscription test message or widget update test message is sent.

In other scenarios, a maximum of 10 tokens can be carried each time a test message is sent.

Reduce the number of tokens and then send messages.

80300036

The validity period of the JWT exceeds one day.

Generate a JWT whose validity period is less than one day and then send the message.

80300037

The message cannot be sent due to penalties for violations.

Handle the violations in AppGallery Connect and send the message again.

81000001

System internal error.

Submit a ticket online for assistance.