tencent cloud

文档反馈

ApplyLivenessToken

最后更新时间:2024-04-03 11:45:36

    1. API Description

    Domain name for API request: faceid.tencentcloudapi.com.

    This API is used to apply for a token before calling the liveness detection service each time. This token is required for initiating the verification process and getting the result after the verification is completed.

    A maximum of 20 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: ApplyLivenessToken.
    Version Yes String Common Params. The value used for this API: 2018-03-01.
    Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-hongkong, ap-jakarta, ap-singapore.
    SecureLevel No String Enumerated value. Valid values: 1, 2, 3, and 4.
    Their meanings are as follows:
    1 - silent
    2 - blinking
    3 - light
    4 - blinking + light (default)

    3. Output Parameters

    Parameter Name Type Description
    SdkToken String The token used to identify an SDK-based verification process. It is valid for 10 minutes and can be used to get the verification result after the process is completed.
    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 Applying for a token

    Input Example

    POST / HTTP/1.1
    Host: faceid.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ApplyLivenessToken
    <Common request parameters>
    
    {
        "SecureLevel": "1"
    }
    

    Output Example

    {
        "Response": {
            "SdkToken": "A561B769-C347-4724-A69A-6C3B3483E107",
            "RequestId": "d73c0c05-f7ff-419c-84cb-0756303b1925"
        }
    }
    

    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.
    InternalError.UnKnown Unknown internal error.
    InvalidParameter Invalid parameter.
    InvalidParameterValue Incorrect parameter value.