Updated on 2024-08-07 GMT+08:00

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 whether they are 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:

Note: 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"
    }]
}
Table 1 Troubleshooting based on the code parameter

Value

Description

Handling Suggestion

000000

The request is 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 application 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 Table 3.
  • 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 application 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 reference.

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.

E000041

X-Sdk-Date is empty.

For special AK/SK authentication, check the value of X-Sdk-Date in the HTTP message header.

E000042

Incorrect X-Sdk-Date format.

For special AK/SK authentication, check the format of X-Sdk-Date in the HTTP message header. The format is yyyyMMdd'T'HHmmss'Z'.

E000043

Incorrect Authorization format.

For special AK/SK authentication, check the format of Authorization in the HTTP message header.

E000044

X-Sdk-Date expires.

For special AK/SK authentication, check the time of X-Sdk-Date in the HTTP header. The difference between the time and the local time when the request is sent cannot exceed 15 minutes. Otherwise, the authentication fails.

E000045

Authorization verification failed.

For special AK/SK authentication, check the Signature field in Authorization of the HTTP message header.

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 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

The time exceeds the 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 user 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 violation, modify the service and contact the operations manager to apply for account unfreezing.

E000503

The parameter format is incorrect.

Check the parameter format. Types of format errors are listed as follows. Handle the problem based on the returned error message.

  • The template variable contains special characters. For details, see Template and Variable Specifications.
  • No template ID is carried.
  • No number is carried.
  • The format of the template ID is incorrect. A template ID can contain 1 to 32 characters.
  • The format of the mobile number is invalid.
  • The number quantity in a single request exceeds the upper limit.
  • smsContent is invalid.
  • The length of the extended field exceeds 128 bytes.

E000510

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

Rectify the fault based on Table 2.

E000620

The peer application IP address is not in the whitelist.

  • It takes about 10 to 15 minutes for the IP address whitelist configuration to take effect. This error may be reported if the configuration does not take effect in time.
  • The IP address whitelist configuration is incorrect. 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 reached the limit.

Adjust limit values of the total number of SMSs sent by referring to Settings. The default limit value of the total number of SMSs sent per day is 500. The default limit value of the total number of SMSs sent per month is 10,000. You can submit a service ticket to increase the limit values.

E000630

Number of SMSs sent reached the country/region limit.

Adjust country/region limit values of SMS sending by referring to Settings.

Table 2 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 batches

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.

E200048

The sending frequency limit is reached.

You can change the sending frequency limit on the Settings page of the console. Alternatively, you can send SMSs after the frequency control time expires.