tencent cloud



Last updated: 2024-04-03 11:45:28
This document is currently invalid. Please refer to the documentation page of the product.

    1. API Description

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

    This API is used to apply for a token before calling the web-based verification 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: ApplyWebVerificationToken.
    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-jakarta, ap-singapore.
    RedirectUrl Yes String The web redirect URL after the verification is completed.
    CompareImageUrl Yes String The COS URL of the image for face comparison, which can be obtained with one of the following methods:
    1. Call the CreateUploadUrl API to generate a URL and call it again after the image is successfully uploaded.
    2. Use an existing COS URL. For a private bucket, grant the download permission with a pre-signed URL. The corresponding COS bucket must be in the same region as the input parameter Region.
    CompareImageMd5 Yes String The MD5 hash values of the image for face comparison (CompareImageUrl).

    3. Output Parameters

    Parameter Name Type Description
    VerificationUrl String The verification URL to be opened with a browser to start the verification process.
    BizToken String The token used to identify a web-based verification process. It is valid for 7,200s 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: ApplyWebVerificationToken
    <Common request parameters>
        "RedirectUrl": "https://www.domain.com/result/callback",
        "CompareImageUrl": "https%3A%2F%2Fsingapore-1257237511.cos.ap-singapore.myqcloud.com%2Ffaceid%2F%2Ftest.png%3Fq-sign-algorithm%3Dsha1%26q-ak%3DAKIDpguZTmihib_W5VoMU1T07CvytjqfY6auKJN6akSM4tmgbmjHnwl2d7EW9TIUYxmK%26q-sign-time%3D1637288206%3B1637291806%26q-key-time%3D1637288206%3B1637291806%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3D7b95d6494e30b05c493ea32db18bbded2e52cd20%26x-cos-security-token%3DkdihJH25E3bZ062DmV2DK1Hv7kE9LQgab4e9fcd283fe59181502e2e1cbecca83iCHquGrh0AClApqec56ahy-298Taz8DrfmRBHFlARDI1XytSLuMcSltSighEh-N7hRDmcug2POunRzWY5JIi7vYiSTxDj1QDZql5o1C6nraxlGkyM-EAZquEK1M6hUXFV6x1_C1G0CpUi3-TJl0cx5M1MUItmdx0h3vZ9u0IuEtZgrvGDrEAViW432lRrlSi",
        "CompareImageMd5": "2455b660dfe11f7e00ddf4831603d897"

    Output Example

        "Response": {
            "BizToken": "0AEEA2AE-7166-4EA4-BD82-3494ECF216BD",
            "RequestId": "f3ef2ddf-c5a6-4e2a-9ac6-441231ba8a61",
            "VerificationUrl": "https://sg.faceid.qq.com/reflect/?token=0AEEA2AE-7166-4EA4-BD82-3494ECF216BD"

    5. Developer Resources


    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.
    InvalidParameter Invalid parameter.
    InvalidParameterValue Incorrect parameter value.
    UnauthorizedOperation.ActivateError Service activation exception.
    UnauthorizedOperation.Activating Activating the service.
    UnauthorizedOperation.Arrears The account is in arrears.
    UnauthorizedOperation.Nonactivated The service has not been activated.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support