目录

REST API Error Codes

Obtaining a User-Level Credential

API URL: https://oauth-login.cloud.huawei.com/oauth2/v3/token

Error codes

HTTP Response Code Description Solution
200 Success. -
400 Parameter error. Further locate the error based on the relevant error code and sub-error code.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.
Error Code Sub-error Code Description Solution
1101 20002 The value of client_id is in an invalid format. Ensure that the value of client_id matches the regular expression ^[0-9]{1,64}$.
1101 20085 When grant_type is set to authorization_code, the value of client_secret is empty. Pass a valid value for the client_secret parameter according to the parameter specifications.
1101 20152 The value of code is in an invalid format.

Ensure that the value of code matches the regular expression ^[0-9a-zA-Z=/\\+]+$.

This error code is returned in the following scenarios:

- The code parameter is tampered with. As a result, the value format is invalid.

- The value of Content-Type in the request header is application/x-www-form-urlencoded. However, the request body is not converted through URL encoding during code running. For details on how to assemble the parameters, please refer to Sample Code.

1101 20154 The client ID obtained by parsing code is different from the value of the input parameter client_id. Ensure that the value of the input parameter client_id is the same as the configured value, as described in Configuring the Client ID.
1101 20155 The authorization code has expired. It is valid for only 5 minutes and becomes unusable thereafter. Guide the user to re-authorize the app to obtain a new authorization code, and retry the operation.
1101 20156 The authorization code has been used. The authorization code can be used only once. Obtain a new authorization code and try again.
1101 20158 The authorization code is invalidated. Although its normal validity period is 5 minutes, it may be revoked prematurely by the Huawei server due to user operations such as password change or app authorization revocation. Guide the user to re-authorize the app to obtain a new authorization code, and retry the operation.
1101 20171 When grant_type is set to device_code, refresh_token, or client_credentials, the value of client_secret is empty. Set grant_type to authorization_code and pass a valid value for client_secret according to the parameter specifications.
1101 20172 The value of client_secret is in an invalid format. Ensure that the value of client_secret matches the regular expression ^[0-9a-zA-Z=/\\+]+$.
1101 20182 The grant_type parameter has an incorrect value.

The options of grant_type are as follows:

- authorization_code: It is used to obtain a user-level credential.

- device_code: It is used to obtain a user-level credential in the scenario of sign-in after authorization by QR code scanning.

- refresh_token: It is used to refresh a user-level credential.

- client_credentials: It is used to obtain an app-level credential.

In the current scenario, the value should be authorization_code.

1102 20001 The client_id parameter is left empty. Pass a valid value for the client_id parameter according to the parameter specifications.
1102 20151 The code parameter is left empty. Pass a valid value for the code parameter according to the parameter specifications.
1102 20181 The grant_type parameter is left empty.

The options of grant_type are as follows:

- authorization_code: It is used to obtain a user-level credential.

- device_code: It is used to obtain a user-level credential in the scenario of sign-in after authorization by QR code scanning.

- refresh_token: It is used to refresh a user-level credential.

- client_credentials: It is used to obtain an app-level credential.

In the current scenario, the value should be authorization_code.

1103 20153 Invalid authorization code. Ensure that the authorization code is correct.
1203 12303 The value of client_id does not exist. Ensure that the client ID (client_id) exists in AppGallery Connect.
1203 12304 Invalid client secret. Ensure that client_id and client_secret match.
1203 500 Internal system error. Record the error code and submit a ticket online.
1203 1203 Unknown system error. Record the error code and submit a ticket online.

Refreshing a User-Level Credential

API URL: https://oauth-login.cloud.huawei.com/oauth2/v3/token

Error codes

HTTP Response Code Description Solution
200 Success. -
400 Parameter error. Further locate the error based on the relevant error code and sub-error code.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.
Error Code Sub-error Code Description Solution
1101 20002 The value of client_id is in an invalid format. Ensure that the value of client_id matches the regular expression ^[0-9]{1,64}$.
1101 20041 The scope format is incorrect, or the number of scopes exceeds 150.

- Ensure that the scope parameter matches the regular expression ^[0-9a-zA-Z:/\\.\u0020]+$.

- Ensure that the number of scopes does not exceed 150.

1101 20042 Invalid scope. The scope parameter contains a forged value. Pass a correct parameter according to the parameter specifications.
1101 20154 The value of client_id in refresh_token is different from that of the input parameter client_id. Ensure that the value of the input parameter client_id is the same as the configured value, as described in Configuring the Client ID.
1101 20171 The client_secret parameter is left empty. Pass a valid value for the client_secret parameter according to the parameter specifications.
1101 20172 The value of client_secret is in an invalid format. Ensure that the value of client_secret matches the regular expression ^[0-9a-zA-Z=/\\+]+$.
1101 20182 The grant_type parameter has an incorrect value.

The options of grant_type are as follows:

- authorization_code: It is used to obtain a user-level credential.

- device_code: It is used to obtain a user-level credential in the scenario of sign-in after authorization by QR code scanning.

- refresh_token: It is used to refresh a user-level credential.

- client_credentials: It is used to obtain an app-level credential.

In the current scenario, the value should be refresh_token.

1101 20192 The value of refresh_token is in an invalid format. Ensure that the value of refresh_token matches the regular expression ^[0-9a-zA-Z=/\\+]+$.
1102 20001 The client_id parameter is left empty. Pass a valid value for the client_id parameter according to the parameter specifications.
1102 20181 The grant_type parameter is left empty.

The options of grant_type are as follows:

- authorization_code: It is used to obtain a user-level credential.

- device_code: It is used to obtain a user-level credential in the scenario of sign-in after authorization by QR code scanning.

- refresh_token: It is used to refresh a user-level credential.

- client_credentials: It is used to obtain an app-level credential.

In the current scenario, the value should be refresh_token.

1102 20191 The refresh_token parameter is left empty. Pass a valid value for the refresh_token parameter according to the parameter specifications.
1203 11205 The refresh token has expired. It is valid for 180 days and becomes unusable thereafter. Guide the user to re-authorize the app to obtain a new refresh token.
1203 12303 The value of client_id does not exist. Ensure that the client ID (client_id) exists in AppGallery Connect.
1203 12304 Invalid client secret. Ensure that client_id and client_secret match.
1203 31202 Failed to parse the refresh token. Ensure that the refresh_token parameter is valid.
1203 31204 The refresh token is invalidated. Although its normal validity period is 180 days, it may be revoked prematurely by the Huawei server due to user operations such as password change or app authorization revocation. Guide the user to re-authorize the app to obtain a new refresh token.
1203 500 Internal system error. Record the error code and submit a ticket online.
1203 1203 Unknown system error. Record the error code and submit a ticket online.

Obtaining an App-Level Credential

API URL: https://oauth-login.cloud.huawei.com/oauth2/v3/token

Error codes

HTTP Response Code Description Solution
200 Success. -
400 Parameter error. Further locate the error based on the relevant error code and sub-error code.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.
Error Code Sub-error Code Description Solution
1101 12304 The value of client_secret is incorrect. Ensure that client_secret is correct in AppGallery Connect.
1101 20002 The value of client_id is in an invalid format. Ensure that the value of client_id matches the regular expression ^[0-9]{1,64}$.
1101 20003 The value of client_id does not exist. Ensure that the client ID (client_id) exists in AppGallery Connect.
1101 20171 The client_secret parameter is left empty. Pass a valid value for the client_secret parameter according to the parameter specifications.
1101 20172 The value of client_secret is in an invalid format. Ensure that the value of client_secret matches the regular expression ^[0-9a-zA-Z=/\\+]+$.
1101 20182 The grant_type parameter has an incorrect value.

The options of grant_type are as follows:

- authorization_code: It is used to obtain a user-level credential.

- device_code: It is used to obtain a user-level credential in the scenario of sign-in after authorization by QR code scanning.

- refresh_token: It is used to refresh a user-level credential.

- client_credentials: It is used to obtain an app-level credential.

In the current scenario, the value should be client_credentials.

1102 20001 The client_id parameter is left empty. Pass a valid value for the client_id parameter according to the parameter specifications.
1102 20181 The grant_type parameter is left empty.

The options of grant_type are as follows:

- authorization_code: It is used to obtain a user-level credential.

- device_code: It is used to obtain a user-level credential in the scenario of sign-in after authorization by QR code scanning.

- refresh_token: It is used to refresh a user-level credential.

- client_credentials: It is used to obtain an app-level credential.

In the current scenario, the value should be client_credentials.

1203 500 Internal system error. Record the error code and submit a ticket online.
1203 1203 Unknown system error. Record the error code and submit a ticket online.

Obtaining a User-Level Credential in the Scenario of Sign-in After Authorization by QR Code Scanning

API URL: https://oauth-login.cloud.huawei.com/oauth2/v3/token

Error codes

HTTP Response Code Description Solution
200 Success. -
400 Parameter error. Further locate the error based on the relevant error code and sub-error code.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.
Error Code Sub-error Code Description Solution
1101 20002 The value of client_id is in an invalid format. Ensure that the value of client_id matches the regular expression ^[0-9]{1,64}$.
1101 20152 The format of code is incorrect.

Ensure that the value of code matches the regular expression ^[0-9a-zA-Z=/\\+]+$.

This error code is returned in the following scenarios:

- The code parameter is tampered with. As a result, the value format is invalid.

- The value of Content-Type in the request header is application/x-www-form-urlencoded. However, the request body is not converted through URL encoding during code running. For details on how to assemble the parameters, please refer to Sample Code.

1101 20154 The client ID obtained by parsing code is different from the value of the input parameter client_id. Check whether the value of the input parameter client_id is the same as that used when the API for obtaining QR code information is called.
1101 20171 The client_secret parameter is left empty. Pass a valid value for the client_secret parameter according to the parameter specifications.
1101 20172 The value of client_secret is in an invalid format. Ensure that the value of client_secret matches the regular expression ^[0-9a-zA-Z=/\\+]+$.
1101 20182 The grant_type parameter has an incorrect value.

The options of grant_type are as follows:

- authorization_code: It is used to obtain a user-level credential.

- device_code: It is used to obtain a user-level credential in the scenario of sign-in after authorization by QR code scanning.

- refresh_token: It is used to refresh a user-level credential.

- client_credentials: It is used to obtain an app-level credential.

In the current scenario, the value should be device_code.

1101 20404 The user code that is used to generate the QR code has expired. Call the API for obtaining QR code information again to generate a new QR code.
1101 20406 The device code has been used to successfully obtain a user-level credential and cannot be used again. Call the API for obtaining QR code information again to generate a new QR code.
1101 20407 Polling attempts to obtain a user-level credential using the device code has exceeded the allowed limit. Call the API for obtaining QR code information again to generate a new QR code.
1101 20408 The value of scope parsed from the device code failed the verification. Pass the specified enumerated values of scope based on the input parameter requirements when calling the API for obtaining QR code information.
1101 20411 The user has not scanned the QR code. This is an expected error. If this error occurs during polling, do not interrupt the polling.
1101 20412 The user has scanned the QR code but has not completed authorization. This is an expected error. If this error occurs during polling, do not interrupt the polling.
1101 20414 The user has scanned the QR code but has canceled authorization on the authorization screen. Call the API for obtaining QR code information again to generate a new QR code.
1102 20001 The client_id parameter is left empty. Pass a valid value for the client_id parameter according to the parameter specifications.
1102 20151 The code parameter is left empty. Pass a valid value for the code parameter according to the parameter specifications.
1102 20181 The grant_type parameter is left empty.

The options of grant_type are as follows:

- authorization_code: It is used to obtain a user-level credential.

- device_code: It is used to obtain a user-level credential in the scenario of sign-in after authorization by QR code scanning.

- refresh_token: It is used to refresh a user-level credential.

- client_credentials: It is used to obtain an app-level credential.

In the current scenario, the value should be device_code.

1203 12303 The value of client_id does not exist. When grant_type is set to device_code, an error that the value of client_id does not exist occurs. Ensure that the client ID (client_id) exists in AppGallery Connect.
1203 12304 Invalid client secret. Ensure that client_id and client_secret match.
1600 16002 Failed to parse the device code. The input parameter code is incorrect. The value of code should match that of device_code returned in the response after calling the API for obtaining QR code information.
1600 16003 The device code has expired. Call the API for obtaining QR code information again to generate a new QR code.
1203 56000 An exception occurs during an internal system call. Record the error code and submit a ticket online.
1203 56100 Connection timed out during an internal system call. Record the error code and submit a ticket online.
1203 56200 A socket timeout occurs during an internal system call. Record the error code and submit a ticket online.
1203 57000 A circuit breaker is triggered during an internal system call. Record the error code and submit a ticket online.
1203 500 Internal system error. Record the error code and submit a ticket online.
1203 1203 Unknown system error. Record the error code and submit a ticket online.

Parsing a Credential

API URL: https://oauth-api.cloud.huawei.com/rest.php?nsp_fmt=JSON&nsp_svc=huawei.oauth2.user.getTokenInfo

Error codes

HTTP Response Code Description Solution
200 The API call is successful. The actual service processing result is indicated by NSP_STATUS in the response header. -
400 Parameter error. Ensure that the request parameters comply with the specifications.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.

The NSP_STATUS field in the response header will not be returned if the service processing is successful.

NSP_STATUS Description Solution
6 Expired access token. The access token is valid for 3600 seconds and becomes unusable thereafter. Guide the user to re-authorize the app to obtain a new access token.
102 Invalid access token. The access_token parameter value is invalid. The possible cause is as follows: The value of Content-Type in the request header is application/x-www-form-urlencoded. However, the request body is not converted through URL encoding during code running. For details on how to assemble the parameters, please refer to Sample Code.
500 Internal API error. Rectify the error based on the returned error description. If the error persists, submit a ticket online.
501 Service distribution exception.

- Ensure that nsp_svc in the request URL is correct.

- If the request URL complies with the specifications, submit a ticket online.

1302 API rate limiting triggered. The API is called too frequently. Try again later.
31204 Access token invalidated. Although the normal validity period of an access token is 3600 seconds, the token may be revoked prematurely by the Huawei server due to user operations such as password change or app authorization revocation. Guide the user to re-authorize the app to obtain a new access token.

Revoking Authorization for a User-Level Credential

API URL: https://oauth-login.cloud.huawei.com/oauth2/v3/revoke

Error codes

HTTP Response Code Description Solution
200 Success. -
400 Parameter error. Further locate the error based on the relevant error code and sub-error code.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.
Error Code Sub-error Code Description Solution
1101 20222 Malformed token.

The token format is incorrect. The possible cause is as follows:

- The value of the token parameter is forged.

- The value of Content-Type in the request header is application/x-www-form-urlencoded. However, the request body is not converted through URL encoding during code running. For details on how to assemble the parameters, please refer to Sample Code.

1102 20221 The token parameter is left empty. Pass a valid value for the token parameter according to the parameter specifications.
1203 11205 Expired tokens. The access token expires after 3600 seconds, and the refresh token expires after 180 days. Once expired, they become invalid. Guide the user to re-authorize the app to obtain new tokens, and retry the operation.
1203 17009 Invalid token. Obtain a new token.
1203 17010 Failed to verify the token. Ensure that the token parameter is valid.
1203 31202 Failed to parse the token. Ensure that the token parameter is valid.
1203 31204 Tokens invalidated. Although the normal validity period of the access token is 3600 seconds and that of the refresh token is 180 days, they may be revoked prematurely by the Huawei server due to user operations such as password change or app authorization revocation. Guide the user to re-authorize the app to obtain new tokens, and retry the operation.
1203 500 Internal system error. Record the error code and submit a ticket online.
1203 1203 Unknown system error. Record the error code and submit a ticket online.

Obtaining QR Code Information

API URL: https://oauth-login.cloud.huawei.com/oauth2/v3/device/code

Error codes

HTTP Response Code Description Solution
200 Success. -
400 Parameter error. Further locate the error based on the relevant error code and sub-error code.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.
Error Code Sub-error Code Description Solution
1101 20002 The value of client_id is in an invalid format. Ensure that the value of client_id matches the regular expression ^[0-9]{1,64}$.
1101 20003 The value of client_id does not exist. Ensure that the client ID (client_id) exists in AppGallery Connect.
1101 20041 The scope format is incorrect, or the number of scopes exceeds 150.

- Ensure that the scope parameter matches the regular expression ^[0-9a-zA-Z:/\\.\u0020]+$.

- Ensure that the number of scopes does not exceed 150.

1101 20042 Invalid scope. The scope parameter contains a forged value. Pass a correct parameter according to the parameter specifications.
1102 20001 The client_id parameter is left empty. Pass a valid value for the client_id parameter according to the parameter specifications.
1600 16001 An exception occurs during device code generation. An exception occurred during device code encoding. Record the error code and submit a ticket online.
1203 500 Internal system error. Record the error code and submit a ticket online.
1203 1203 Unknown system error. Record the error code and submit a ticket online.

Obtaining User Information

API URL: https://account.cloud.huawei.com/rest.php?nsp_svc=GOpen.User.getInfo

Error codes

HTTP Response Code Description Solution
200 The API call is successful. (A successful API call does not mean successful service processing. If the NSP_STATUS field is returned in the response header, an error occurred during service processing, and you need to identify the root cause of the error.) -
400 Parameter error. Ensure that the request parameters comply with the specifications.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.

The NSP_STATUS field in the response header will not be returned if the service processing is successful.

NSP_STATUS Description Solution
6

The session is invalid or has timed out (session timeout).

Possible causes:

- The access token is invalid or has expired.

- The access token format is incorrect.

- Other internal causes.

- Check whether the passed parameters are correct. If yes, try to obtain a new access token.

- For access tokens that have not been URL-encoded, please refer to the sample code for instructions on how to assemble the parameters.

- Rectify the error based on the returned error description. If the error persists, submit a ticket online.

105 Parameter error. Modify the value according to the API Reference.
403 No access permission. Go to AppGallery Connect to request scopes for your app. For details, please refer to Requesting Scopes.
500 Internal API error. Rectify the error based on the returned error description. If the error persists, submit a ticket online.
503 System rate limiting triggered. Try again later.
70001201 Invalid parameter. Modify the value according to the API Reference.
70001402 System authentication error. The authentication system is abnormal. If the error persists after retry, submit a ticket online.
70020002 Internal network error. The internal network is abnormal. If the error persists after retry, submit a ticket online.
70001401 Internal system error. Rectify the error based on the returned error description. If the error persists, submit a ticket online.

Obtaining the UnionID/OpenID and Mobile Number Bound to a HUAWEI ID with One-Tap Sign-In

API URL: https://account-api.cloud.huawei.com/oauth2/v6/quickLogin/getPhoneNumber

Error codes

HTTP Response Code Description Solution
200 The API call is successful. The actual service processing result is indicated by resultCode in the response body. -
400 Parameter error. Ensure that the request parameters comply with the specifications.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.
Error Code Description Solution
60010002 Invalid parameter. Check the input parameters according to the error description and the parameter description in Request Body.
60010012 The value of the code parameter is incorrect. The value of the code parameter is incorrect. The possible cause is that the value of code is invalid or is tampered with.
60010013 The value of the clientSecret parameter is incorrect. The value of clientSecret is incorrect. For details about the value, please refer to the Client secret field under OAuth 2.0 client ID in Viewing App Basic Information.
60180003 The client ID obtained by parsing code is different from the value of the input parameter clientId. The value of clientId in code is different from that of the input parameter clientId. Ensure that the value of the input parameter clientId is the same as the configured value, as described in Configuring the Client ID.
60180004 The authorization code has expired. It is valid for only 5 minutes and becomes unusable thereafter. Guide the user to re-authorize the app to obtain a new authorization code, and retry the operation.
60180005 The authorization code has been used. The authorization code can be used only once. Obtain a new authorization code and try again.
60180006 The authorization code is invalidated. Although its normal validity period is 5 minutes, it may be revoked prematurely by the Huawei server due to user operations such as password change or app authorization revocation. Guide the user to re-authorize the app to obtain a new authorization code, and retry the operation.
60180007 The authorization code does not include the scope for one-tap HUAWEI ID sign-in.

The possible causes are as follows:

- When developing the one-tap HUAWEI ID sign-in function on the app side, LoginWithHuaweiIDButtonParams.loginType is not set to LoginType.QUICK_LOGIN.

- The authorization code sent by the app to the server is the one obtained during the number pre-fetching phase of one-tap HUAWEI ID sign-in.

- The authorization code sent by the app to the server is not obtained in the one-tap HUAWEI ID sign-in scenario.

For details about how to address the above possible causes, please refer to 60180007 What Should I Do If the Server Cannot Obtain the One-tap Sign-in Mobile Number of a HUAWEI ID Through the Authorization Code?

60180008 No mobile number bound. Check whether a mobile number is bound to the user's HUAWEI ID. If not, show the sign-in screen that contains other sign-in options.
60180009 The mobile number cannot be obtained. The one-tap HUAWEI ID sign-in service is available only to users in the Chinese mainland.
60010001 Internal system error. Try again later. If the error persists, submit a ticket online.

Obtaining a User's Risk Level

API URL: https://account.cloud.huawei.com/user/getuserrisklevel

Error codes

HTTP Response Code Description Solution
200 The API call is successful. (A successful API call does not mean successful service processing. The actual service processing result is indicated by errCode in the response body.) -
400 Parameter error. Ensure that the request parameters comply with the specifications.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
415 Unsupported media type. Ensure that the content type (contentType) for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.
errCode Description Solution
6

The session is invalid or has timed out (session timeout).

Possible causes:

- The access token is invalid or has expired.

- The access token format is incorrect.

- Other internal causes.

- Check whether the passed parameters are correct. If yes, try to obtain a new access token.

- The request data format of this API is application/json;charset=utf-8. When constructing a request body, ensure that the URL encoding is not performed on the access_token parameter. For details on parameter assembly, please refer to Sample Code.

- Rectify the error based on the returned error description. If the error persists, submit a ticket online.

403 No access permission. Go to AppGallery Connect to request scopes for your app. For details, please refer to Requesting Scopes.
503 System rate limiting triggered. Try again later.
70001201 Request parameter error. Modify the parameters in the request URL or request body.
70001402 System authentication error. The authentication system is abnormal. If the error persists after retry, submit a ticket online.
70020002 Internal API request timeout. Try again later.
70001401 Internal API error. Rectify the error based on the returned error description. If the error persists, submit a ticket online.

Obtaining Real-Name Information

API URL: https://openrealname.cloud.huawei.com/rest.php?nsp_svc=OpenRealName.User.getDetailInfo

Error codes

HTTP Response Code Description Solution
200 The API call is successful. The actual service processing result is indicated by NSP_STATUS in the response header. -
400 Parameter error. Ensure that the request parameters comply with the specifications.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.

The NSP_STATUS field in the response header will not be returned if the service processing is successful.

NSP_STATUS Description Solution
6

Session invalidated (session timeout).

Possible causes:

- The access token is invalid or has expired.

- The access token format is incorrect.

- For invalid or expired access tokens, check whether the passed parameters are correct. If yes, try to obtain a new access token.

- For access tokens that have not been URL-encoded, please refer to the sample code for instructions on how to assemble the parameters.

105 Incorrect value of nsp_svc in the request URL. Ensure that nsp_svc in the request URL is valid.
403 No access permission. Check related constraints.
500 Internal API error. Rectify the error based on the returned error description. If the error persists, submit a ticket online.
503 API rate limiting triggered. The API is called too frequently. Try again later.
70001201 Request parameter error. Locate the error cause based on the error description, rectify the error, and try again.
70001401 Internal service error. Submit a ticket online.
70009019 The real-name information does not exist. Guide the user to complete real-name verification or use a real-name verified account. If the error persists, submit a ticket online.

Verifying Real-Name Information

API URL: https://openrealname.cloud.huawei.com/rest.php?nsp_svc=OpenRealName.User.verifyRealName

Error codes

HTTP Response Code Description Solution
200 The API call is successful. The actual service processing result is indicated by NSP_STATUS in the response header. -
400 Parameter error. Ensure that the request parameters comply with the specifications.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.

The NSP_STATUS field in the response header will not be returned if the service processing is successful.

NSP_STATUS Description Solution
6

Session invalidated (session timeout).

Possible causes:

- The access token is invalid or has expired.

- The access token format is incorrect.

- For invalid or expired access tokens, check whether the passed parameters are correct. If yes, try to obtain a new access token.

- For access tokens that have not been URL-encoded, please refer to the sample code for instructions on how to assemble the parameters.

105 Incorrect value of nsp_svc in the request URL. Ensure that nsp_svc in the request URL is valid.
403 No access permission. Check related constraints based on Constraints.
404 Service not found. Ensure that the request URI is correct.
500 Internal API error. Rectify the error based on the returned error description. If the error persists, submit a ticket online.
503 API rate limiting triggered. The API is called too frequently. Try again later.
70001201 Request parameter error. Locate the error cause based on the error description, rectify the error, and try again.
70001401 Internal service error. Submit a ticket online.
70009019 The real-name information does not exist. Guide the user to complete real-name verification or use a real-name verified account. If the error persists, submit a ticket online.

Obtaining the Age Group of a User

API URL: https://account-realname-api.cloud.huawei.com/openrealname/v6/realname-info/get

Error codes

HTTP Response Code Description Solution
200 The current API call is successful. (A successful API call does not mean successful service processing. If the resultCode field is returned in the response body, an error occurred during service processing, and you need to identify the root cause of the error.) -
400 Parameter error. Ensure that the request parameters comply with the specifications.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.

The resultCode field in the response body will not be returned if the service processing is successful.

resultCode Description Solution
60010002 Invalid parameter. Check the input parameters according to the error description and the parameter description in Request Body.
60010003 Invalid authentication information. Check the value of the Authorization parameter in the header. The possible cause is that no value is passed or the value is incorrect.
60010014

Session invalidated.

Possible causes:

- The access token format is incorrect.

- The access token is invalid or has expired.

Check the value of the Authorization parameter in the header. Ensure that the app includes the realNameAgeRange scope when requesting the authorization code. For details, please refer to Obtaining a User-Level Credential.
61110001 System rate limiting triggered. Try again later.
61110002

The scopes granted in the access token are insufficient.

Possible causes:

- The app has not requested the realNameAgeRange scope.

- The realNameAgeRange scope is not passed in the request to obtain an authorization code.

- Request the realNameAgeRange scope. For details, please refer to Requesting Scopes.

- Check the value of the Authorization parameter in the header. Ensure that the app includes the realNameAgeRange scope when requesting the authorization code. For details, please refer to Obtaining a User-Level Credential.

61110003 The client ID in the access token is inconsistent with the input parameter clientId. Ensure that the client ID included in the request for obtaining the authorization code is the same as the value of clientId in the request body.
60010001 Internal system error. Rectify the error based on the returned error description. If the error persists, submit a ticket online.

Obtaining the UnionID Through the OpenID

API URL: https://oauth-login.cloud.huawei.com/rest.php?nsp_svc=huawei.oauth2.app.openIdToUnionId

Error codes

HTTP Response Code Description Solution
200 The API call is successful. The actual service processing result is indicated by NSP_STATUS in the response header. -
400 Parameter error. Ensure that the request parameters comply with the specifications.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.

The NSP_STATUS field in the response header will not be returned if the service processing is successful.

NSP_STATUS Description Solution
6 Expired access token. The access token is valid for 3600 seconds and becomes unusable thereafter. Obtain a new access token by calling the API for obtaining an app-level credential.
102 Invalid access token. The access_token parameter value is invalid. The possible cause is as follows: The value of Content-Type in the request header is application/x-www-form-urlencoded. However, the request body is not converted through URL encoding during code running. For details on how to assemble the parameters, please refer to Sample Code.
403 No access permission. Obtain an access token by calling the API for obtaining an app-level credential. Access tokens obtained via other methods cannot be used to call this API.
500 Internal API error. Rectify the error based on the returned error description. If the error persists, submit a ticket online.
501 Service distribution exception.

- Ensure that nsp_svc in the request URL is correct.

- If the request URL complies with the specifications, submit a ticket online.

1302 API rate limiting triggered. The call frequency is too high. Keep the concurrent calls per app below 100 TPS.
31204 Access token invalidated. This error does not occur for access tokens obtained by calling the API for obtaining an app-level credential. Strictly follow the API specifications to obtain an access token by calling the API for obtaining an app-level credential and try again.
150028 Invalid open_id.

The open_id parameter is invalid. The possible causes are as follows:

- The open_id parameter is left empty.

- The format of the open_id parameter is incorrect. For details about the format requirements, please refer to Formats of OpenID and UnionID.

Obtaining OpenID Connect Public Configurations

API URL: https://oauth-login.cloud.huawei.com/.well-known/openid-configuration

Error codes

HTTP Response Code Description Solution
200 Success. -
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.

Obtaining the JWT Public Key for ID Token Verification

API URL: https://oauth-login.cloud.huawei.com/oauth2/v3/certs

Error codes

HTTP Response Code Description Solution
200 Success. -
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.

Verifying an ID Token

API URL: https://oauth-login.cloud.huawei.com/oauth2/v3/tokeninfo

Error codes

HTTP Response Code Description Solution
200 Success. -
400 Parameter error. Further locate the error based on the relevant error code and sub-error code.
403 No access permission. Check the network environment configuration to see if the access is blocked by the caller's network security policy. If the error persists, submit a ticket online.
404 Service not found. Ensure that the request URI is correct.
405 Unsupported HTTP request method. Ensure that the method for the HTTP request complies with the API specifications.
500 Internal service error. Submit a ticket online.
502 Connection error. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
503 System rate limiting triggered. Rate limiting has been triggered by the system. Try again later.
504 Connection timed out. This typically occurs when network connectivity is unstable. Try again later. If the error persists, submit a ticket online.
590 Internal service error. Submit a ticket online.
Error Code Sub-error Code Description Solution
1203 100305 The header obtained from the parsed ID token is not in JSON format. The value format of id_token is incorrect or its value is forged. Ensure that its value is the original one returned by the HUAWEI ID.
1203 100306 The payload obtained from the parsed ID token is not in JSON format. The value format of id_token is incorrect or its value is forged. Ensure that its value is the original one returned by the HUAWEI ID.
1203 150021 Failed to parse the header of the ID token. The value format of id_token is incorrect or its value is forged. Ensure that its value is the original one returned by the HUAWEI ID.
1203 150022 Failed to parse the payload of the ID token. The value format of id_token is incorrect or its value is forged. Ensure that its value is the original one returned by the HUAWEI ID.
1203 150023 Failed to parse the signature of the ID token. The value format of id_token is incorrect or its value is forged. Ensure that its value is the original one returned by the HUAWEI ID.
1400 14004 The JWT public key is not found based on the value of kid. Submit a ticket online.
1500 15003 Invalid ID token. The value format of id_token is incorrect or its value is forged. Ensure that its value is the original one returned by the HUAWEI ID.
1500 15004 Failed to verify the ID token. The value format of id_token is incorrect or its value is forged. Ensure that its value is the original one returned by the HUAWEI ID.
1500 15005 Failed to verify the issuer of the ID token. Ensure that the value of id_token is the original one returned by the HUAWEI ID.
1500 15006 The ID token has expired. Obtain a new ID token.
1500 15007 The id_token parameter is left empty. Pass a valid value for the id_token parameter according to the parameter specifications.
1500 15008 The ID token format is incorrect. Ensure that the value of id_token matches the regular expression ^[0-9a-zA-Z_\-\.]+$.
1203 500 Internal system error. Record the error code and submit a ticket online.
1203 1203 Unknown system error. Record the error code and submit a ticket online.