Updated on 2023-07-20 GMT+08:00
API Error Codes

API Error Codes

This section describes all error codes returned when calling APIs fails. You are advised to press Ctrl+F to search for error codes on the page and find the required handling suggestions.

Solution for 404 Error

If a 404 message is returned when an API is called, check whether the application access address and URI (for details, see Development Preparation) are correct and combined into a complete request URL, for example, https://smsapi.ap-southeast-1.myhuaweicloud.com:443/sms/batchSendSms/v1.

Error Codes and Handling Suggestions

API calling error codes are generated when the SMS Sending API or Batch SMS Sending API is called. An example response is as follows:

One response contains only one error code, and one mobile number corresponds to one status.

HTTP/1.1 200 OK
Date: Mon, 06 Aug 2018 11:59:50 GMT
Server: WebServer
Content-Type: application/json;charset=UTF-8
Content-Length: 224

{
    "code":"000000",
    "description":"Success",
    "result":
    [{
        "originTo":"+8618612345678",
        "createTime":"2018-08-06T11:59:50Z",
        "from":"1069031221280000001",
        "smsMsgId":"4b4b34e7-1a9e-42ac-b309-d10997148905_85496076",
        "status":"000000"
    }]
}

Troubleshooting Based on the code Parameter

Value

Description

Handling Suggestion

000000

A request was sent successfully.

API calling was successful. Wait for the SMS status report.

E000000

The system is abnormal. Typically, this means SMS platform cannot parse the request format because the format is incorrect.

  • Check the SMS template and make sure that {} (curly braces) are used for variables, not regular parenthesis. Apply for a new template.
  • Check whether the quotation marks in the value of templateParas are properly used. Refer to the code examples for reference.
    • When calling the SMS Sending API, set templateParas to a character string. The value of templateParas and those of template variables require quotation marks. Use escape characters, single quotation marks, or double quotation marks properly.

      Example: templateParas='["3","'Gate of People's Park"]'

    • When calling the Batch SMS Sending API, set templateParas to a character string array. The value of templateParas does not require quotation marks, but the value of each template variable does.

      Example: templateParas=["3","'Gate of People's Park"]

E000001

Authorization is not contained in the HTTP header.

  • Check whether the HTTP message header contains the Authorization field.
  • Check whether the app key is empty or incorrect.
  • Check whether the difference between the input Created time and the current UTC time is less than 24 hours. Created indicates the UTC time when the random string is generated, for example, 2018-02-12T15:30:20Z. The time formats vary by programming language. For details, see Time formats in different programming languages.
  • Check whether the input value of passwordDigest matches the value of passwordDigest obtained using the encryption mode supported by the service.

    The value of passwordDigest is generated based on Base64 (SHA256 (Nonce + Created + Password)). The string consisting of Nonce, Created, and Password is SHA256 encrypted and does not contain plus signs (+) or spaces. Password indicates the value of app secret.

E000002

realm is not contained in Authorization.

Check whether the Authorization field contains the realm attribute.

E000003

profile is not contained in Authorization.

Check whether the Authorization field contains the profile attribute.

E000004

The value of realm in Authorization must be SDP.

Check whether the value of realm in the Authorization field is SDP.

E000005

The value of profile in Authorization must be UsernameToken.

Check whether the value of profile in the Authorization field is UsernameToken.

E000006

The value of type in Authorization must be Appkey.

Check whether the value of type in the Authorization field is Appkey.

E000007

type is not contained in Authorization.

Check whether the Authorization field contains the type attribute.

E000008

WSSE is not contained in Authorization.

Check whether the Authorization field contains WSSE.

E000020

X-WSSE is not contained in the HTTP header.

Check whether the HTTP message header contains the X-WSSE field.

E000021

UserName is not contained in X-WSSE.

Check whether the X-WSSE field contains the UserName attribute.

E000022

Nonce is not contained in X-WSSE.

Check whether the X-WSSE field contains the Nonce attribute.

E000023

Created is not contained in X-WSSE.

Check whether the X-WSSE field contains the Created attribute.

E000024

PasswordDigest is not contained in X-WSSE.

Check whether the X-WSSE field contains the PasswordDigest attribute.

E000025

The format of Created is incorrect.

Check whether the format of the Created attribute in the X-WSSE field is correct.

E000026

UsernameToken is not contained in X-WSSE.

Check whether the X-WSSE field contains the UsernameToken attribute.

E000027

Invalid request.

Check whether the parameters in the request are valid based on the parameter description and requirements in the API document.

E000040

The value of ContentType must be application/x-www-form-urlencoded.

Check whether the value of the ContentType header field is application/x-www-form-urlencoded. To send SMSs, set ContentType to application/x-www-form-urlencoded. To send SMSs in batches, set ContentType to application/json.

E000101

Authentication failed.

Check whether the values of Authorization and X-WSSE are correct.

E000102

app_key is invalid.

Check whether app_key in the request is correct.

If app_key is correct, check whether the application access address (obtained from the Application Management page on the console) is correct.

E000103

app_key is unavailable.

Contact the administrator to check whether the app_key status is normal.

E000104

app_secret is invalid.

Check whether app_secret in the request is correct.

E000105

PasswordDigest is invalid.

Check whether PasswordDigest included in the request is correct.

E000106

The app_key does not have the permission to call this API.

Contact the administrator to check whether the application corresponding to the app_key supports SMS capability exposure.

E000109

The user is deactivated.

Contact the administrator to activate the user.

E000110

Time out limit.

When X-WSSE authentication is used, make sure that there is not too much difference between the time when the random string is generated and the local time when the request is sent. For details, contact the administrator.

Check whether the local time of the server is correct. It is recommended that the difference between the local time of the server and the Beijing time be less than or equal to 8 hours.

Check the code for the Created parameter that indicates the random number generation time. Take Java as example. Change YYYY in the format string to yyyy. For details, see SMS Sending API.

E000111

Incorrect username or password.

The user information corresponding to app_key cannot be found. Contact the administrator.

E000112

The subscriber status is frozen.

If the account is frozen due to arrears, top up the account by referring to Topping Up an Account (Prepaid Direct Customers). Then, the account is automatically unfrozen.

If the account is frozen due to business violation, rectify the business and contact the operation manager to apply for account unfreezing.

E000503

The parameter format is incorrect.

Check whether the parameter format is correct.

E000510

The SMS fails to be sent. For details about the failure cause, see the status parameter.

Rectify the fault based on the Troubleshooting Based on the status Parameter.

E000620

The app client IP address is not in the whitelist.

On the console, choose Application Management, click Modify, and check and modify the configured IP address whitelist, or add a correct IP address whitelist (when it is configured by the platform administrator).

E000623

Number of SMSs sent by the SP reached the limit.

Contact the operation manager to increase the maximum number of SMSs sent by the SP.

E000628

Countries or regions of the recipient numbers are not in the whitelist.

Countries or regions of the recipient numbers are not added to the whitelist when you set the regional threshold, causing the SMS sending failure. Add countries or regions of the recipient numbers to the whitelist by referring to region settings.

Troubleshooting Based on the status Parameter

Value

Description

Handling Suggestion

E200015

The number of SMSs to be sent exceeds the upper limit.

The SMS platform is performing flow control. Wait for about 10 minutes and try again.

E200028

The template variable verification failed.

Check the value of templateParas in the request. Check whether the number of variables in the template is correct and whether the length of the variables is less than the specified length of the template specified by templateId.

If the template specified by templateId is a non-variable template, the request does not carry templateParas. If templateParas is included, leave it blank.

For example:

Your verification code is ${NUM_6}. Finish the verification as soon as possible. Have a nice day!

Note: The template contains a variable of the numeric type. The variable contains a maximum of six digits.

The following are examples of correct values:

templateParas='["12345"]'; //API for sending SMS messages

templateParas=["345678"]; //API for sending SMS messages in batch

The following are examples of incorrect values:

templateParas='["123","456"]'; //API for sending SMS messages. The number of variables is incorrect.

templateParas='["1234567"]'; //API for sending SMS messages. The variable length is incorrect.

templateParas='["1a2b3c"]'; //API for sending SMS messages. The variable content type is incorrect.

E200029

The template type verification failed.

Check the values of templateId and from in the request and verify that the template ID, signature sender number, and type are correct.

  1. Log in to the Message & SMS console. Choose Chinese Mainland SMS > Template Management. Check Template Type and Signature based on the value of templateId.
  2. Log in to the Message & SMS console. Choose Chinese Mainland SMS > Signature Management. Check Signature Type and Signature Name based on the value of from.
  3. Check whether the template type is consistent with the signature type, and whether the signature is consistent with the signature name.

    If a common signature is used, you do not need to check the consistency between the signature and signature name.

E200030

The template is not activated.

Check whether the value of templateId in the request is correct.

E200031

The protocol verification failed.

Check whether the values of Application Key and Application Secret are correct.

E200033

The template type is incorrect.

Rectify the fault by referring to the recommendation for E200029. Wait for about 10 minutes and send the request again.

E200041

The recipient numbers of the same SMS are duplicate.

The SMS platform automatically deletes duplicate numbers and sends only one SMS to the number.