Quick API Run

Last updated: 2020-08-03 12:12:04

    Operation Scenarios

    This document describes how to call Tencent Cloud FaceID APIs through API 3.0 Explorer and integrate SDKs in the corresponding programming language into your project after you purchase the FaceID service. You can access FaceID APIs quickly in the following steps.

    Prerequisites

    Enter API 3.0 Explorer to call APIs in the following steps.

    Directions

    Step 1

    Select the CompareFace API on the left sidebar.

    Step 2

    Enter your private key information and required parameters.

    • Region: region information in the domain name that determines the access point. For example, faceid.ap-shanghai.tencentcloudapi.com indicates that Shanghai is the access point. The common parameter Region specifies the region of business resources to be accessed; for example, Region=ap-beijing indicates resources in the Beijing region will be accessed. If the region information is not specified in the domain name, nearby access will be enabled by default, which may cause problems. If an IP cannot be resolved, Guangzhou region will be used by default. The region for the domain name and the common parameter Region can be different, but this may increase access latency. We recommend using the same region for the domain name and the common parameter Region, such as South China (Guangzhou)/ap-guangzhou.
    • RuleId: used to specify use cases. After your apply to activate the service, you can create RuleId through the FaceID Console and call it after your application is approved. If you have any questions, please contact the FaceID WeChat assistant (account: faceid001).

    Step 3

    Select the programming language to generate codes.
    Enter the parameters on the left to generate codes. Part of the field information in the generated code is subject to the entered content. To adjust an input parameter, modify its value on the left and generate the code again.

    Step 4

    Integrate the SDK into the project.
    Integrate the SDK into the project as instructed in the usage guide on the upper right-hand corner. You can call the corresponding API using the code generated in [step 3](#Step 3).

    Notes

    • You only need to focus on the Region field in common parameters when using SDKs to make calls. We recommend using ap-guangzhou for both the domain name and Region.
    • Address for generating SecretId/SecretKey: https://console.cloud.tencent.com/cam/capi.
    • For base64-encoded images or videos, remove the data:image/jpg;base64, prefix and the \n line break.
    • If the request result is as shown below, you need to manually configure the signature type:
      [TencentCloudSDKException]message:AuthFailure.SignatureFailure-The provided credentials
      could not be validated because of exceeding request size limit, please use new signature 
      method `TC3-HMAC-SHA256`. requestId:719970d4-5814-4dd9-9757-a3f11ecc9b20
      Configure the signature type:
      clientProfile.setSignMethod("TC3-HMAC-SHA256"); // Specify the signature algorithm (default value: HmacSHA256)
    • If the API request exceeds 1 MB, only v3 authentication (TC3-HMAC-SHA256) can be used. API 3.0 SDK supports Node.js, Python, Java, PHP, and Go, but not .NET and C#. You need to implement API authentication v3 to call APIs. We recommend using the signature generation tool in API 3.0 Explorer to verify the signature.