tencent cloud

APIs

DescribeCaptchaResult

Unduh
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-09-18 11:36:31

1. API Description

Domain name for API request: captcha.intl.tencentcloudapi.com.

This API is used to check the ticket results of verification codes for Web and APP.

A maximum of 1000 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeCaptchaResult.
Version Yes String Common Params. The value used for this API: 2019-07-22.
Region No String Common Params. This parameter is not required.
CaptchaType Yes Integer

Fixed value: 9.

Ticket Yes String

User verification ticket returned by the frontend callback function

UserIp Yes String

Public network IP of the verification

Randstr Yes String

Random string returned by the frontend callback function

CaptchaAppId Yes Integer

Captcha appId. Log in to the verification code console. In the [Key] column of the verification list, you can see CaptchaAppId.

AppSecretKey Yes String

Captcha application key. Log in to the verification code console, and view AppSecretKey in the [Key] column of the verification list. AppSecretKey is a key for server-side verification of verification code tickets. Keep it confidential and do not leak it to third parties.

BusinessId No Integer

Reserved field

SceneId No Integer

Reserved field

MacAddress No String

mac address or unique device identifier

Imei No String

Mobile device number

NeedGetCaptchaTime No Integer

Whether to return the time when the frontend obtains the verification code. Value: 1: need to return

3. Output Parameters

Parameter Name Type Description
CaptchaCode Integer

1 OK verification passed
7 captcha no match The passed-in Randstr is invalid. Please check whether Randstr is consistent with the frontend Randstr.
8 ticket expired The passed-in ticket has expired (ticket valid period is 5 minutes). Please generate a new ticket and Randstr for verification.
9 ticket reused The passed-in ticket has been reused. Please generate a new ticket and Randstr for verification.
15 decrypt fail The passed-in ticket is invalid. Please check whether ticket is consistent with the frontend ticket.
16 appid-ticket mismatch The passed-in CaptchaAppId is incorrect. Please check whether CaptchaAppId is consistent with the frontend CaptchaAppId, and ensure that CaptchaAppId is obtained from [Verification Management] -> [Basic Configuration] in the verification code console.
21 diff Bill verification exception. Possible reasons: (1) If the ticket contains the trerror prefix, it is generally because the user has a poor network connection, which causes frontend automatic disaster recovery and generates a disaster recovery ticket. The business side can skip or post-process it based on needs. (2) If the ticket does not contain the trerror prefix, it is because the verification code risk control system has detected a security risk in the request. The business side can block it based on needs.
100 appid-secretkey-ticket mismatch Parameter validation error. (1) Please check whether CaptchaAppId and AppSecretKey are correct. CaptchaAppId and AppSecretKey need to be obtained from [Verification Management] > [Basic Configuration] in the verification code console. (2) Please check whether the passed-in ticket is generated by the passed-in CaptchaAppId.

CaptchaMsg String

Description and error message

EvilLevel Integer

In non-perception mode, this parameter returns the verification result:
EvilLevel=0: The request is not malicious
EvilLevel=100: The request is malicious

GetCaptchaTime Integer

Frontend verification code retrieval time, Timestamp Format

EvilBitmap Integer

Interception type

SubmitCaptchaTime Integer

Time of submitting the verification code

DeviceRiskCategory String

Device risk category

Score Integer

Verification code score

Value range: 0-100. Higher scores indicate higher risk

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Request and return example

Invoice verification

Input Example

POST / HTTP/1.1
Host: captcha.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCaptchaResult
<Common request parameters>

{
    "CaptchaAppId": 199999164,
    "CaptchaType": 9,
    "NeedGetCaptchaTime": 1,
    "Randstr": "@Vki",
    "UserIp": "127.0.0.1",
    "Ticket": "tr03XaCUZPAlPdIMqv17yvcfdXCzkqvLE09AbCA4ghlWfD8hkySfbU2TZVCyoOCjNI84pAYEMopKv7Uh8XwQDSE9DC0xJpXVC7kmlPENlbFINs_N937qkoEmU6Pl8e-9EkFQzvrrwsZOTKQ*",
    "AppSecretKey": "E4kwK9AcXQMHkktiItyMEyQPn"
}

Output Example

{
    "Response": {
        "CaptchaCode": 0,
        "CaptchaMsg": "not valid",
        "EvilLevel": 0,
        "GetCaptchaTime": 1729583235,
        "SubmitCaptchaTime": 1729583239,
        "EvilBitmap": 0,
        "RequestId": "7c370964-7deb-4008-8b29-47e87e60c1e0"
    },
    "retcode": 0,
    "retmsg": "success"
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError Internal error.
MissingParameter Parameters are missing.
UnauthorizedOperation.ErrAuth Authentication failed.
UnauthorizedOperation.Unauthorized Operation not authorized/No valid package/The account is overdue

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan