Client initialization errors

更新时间:
复制 MD 格式

Initialization API error codes

The CAPTCHA initialization API sends a request that contains a user tag to obtain CAPTCHA resources. The request domain is xxxxx.captcha-open.aliyuncs.com, where xxxxx is the user tag. To learn how to obtain a user tag, see Activate the CAPTCHA service. A successful initialization request returns a response similar to the following example:

{
  "CaptchaType": "INPAINTING",
  "CertifyId": "axxx",
  "Code": "Success",
  "DeviceConfig": "0NtwB5Lb4R602aF1IO1CHB1qKWQndQ1qXjwNGcoZH1NlVqy+VBr2wtb/Nb0n74tj/zuzGL+3a80pCT09GbHBTY+p13...",
  "Image": "qst/aigc/online/2/22b4e2a9-6229-4679-a8da-8f214f9722c9/inpainted_with_mask.png",
  "LimitFlow": false,
  "Message": "success",
  "PuzzleImage": "qst/aigc/online/2/22b4e2a9-6229-4679-a8da-8f214f9722c9/bitwise_and_result.png",
  "RequestId": "3xxx0",
  "StaticPath": "1xxx",
  "Success": true
}

If an initialization request fails, see the table below for error descriptions and troubleshooting suggestions.

Error code

Description

IllegalUserTag

The user tag (prefix) parameter is invalid. Refer to Activate the CAPTCHA service to verify that the parameter is passed correctly.

Important

The IllegalUserTag error code applies only to Web and H5 client integration and app client integration. It does not apply to WeChat mini program integration.

IllegalCertifyId

The format of the custom certifyId (UserCertifyId) parameter is invalid. Ensure that the parameter follows the required format: user tag (prefix)_10-character random string (containing uppercase letters, lowercase letters, and digits). For a code example, see UserCertifyId parameter code example.

IllegalScene

The scenario ID (SceneId) parameter is invalid. Verify that the scenario ID parameter is correct and that the specified scenario ID was created in the account associated with the user tag (prefix).

Forbidden.AccountAccessDenied

The account has an overdue payment. Check your account status and resolve any outstanding payments.

Throttling

The API call is rate-limited because the number of queries per second (QPS) has exceeded the product limit. If you require a higher business capacity, you can purchase additional QPS. The new limit does not take effect immediately. Contact your account manager at least two days in advance to configure the new limit.

ThrottlingByStrategy

The initialization request is rate-limited to block attackers who frequently send requests to iterate through the CAPTCHA challenge library.

Initialization parameter validation errors

Important

Initialization parameter validation errors apply only to Web and H5 client integration and app client integration. They do not apply to WeChat mini program integration.

Before the client sends a CAPTCHA initialization request, the SDK validates the initialization parameters. If a parameter is invalid, the SDK reports an error in the browser developer tools console. The following table describes the validation details.

Field

Error message

Example

General type validation

The data type of the input parameter is invalid. Refer to Parameter description and pass a value of the correct type.

For example, if you pass the string 'false' for the immediate parameter, the following error is reported:

The data type of the immediate parameter is invalid. Refer to the documentation and pass a value of the correct type.    AliyunCaptcha.js:1

language

The value of the language parameter is invalid. For more information, see Languages supported by Captcha 2.0.

For example, if you pass 'abc' for the language parameter, the following error is reported:

The value of the language parameter is invalid. For more information, see the list of supported languages for Captcha 2.0.    AliyunCaptcha.js:1

region

The value of the region parameter is invalid. See the region parameter documentation for details.

For example, if you pass 'zh' for the region parameter, the following error is reported:

The value of the region parameter is invalid. See the region parameter description for details.    AliyunCaptcha.js:1

mode

The value of the mode parameter is invalid. The supported values are popup and embed. See the mode parameter documentation for details.

For example, if you pass 'popout' for the mode parameter, the following error is reported:

The value of the mode parameter is invalid. Supported values are popup and embed. See the mode parameter description for details.    AliyunCaptcha.js:1

element/button

The value of the element or button parameter is invalid. Ensure the parameter value is the ID of an existing element on the page.

For example, if you pass 'abc' for the element or button parameter but no element with the ID "abc" exists on the page, the following error is reported:

The value of the element parameter is invalid. Ensure that the element exists on the page and that the parameter value matches the ID selector of the element.    AliyunCaptcha.js:1
The value of the button parameter is invalid. Ensure that the button exists on the page and that the parameter value matches the ID selector of the button.    AliyunCaptcha.js:1