tencent cloud

eKYC

Release Notes and Announcements
Release Notes
Product Announcements
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Purchase Method
Payment Overdue
Refund
Integration Guide
Getting Started
Selfie Verification (Pure API)
Selfie Verification (Mobile HTML5)
Selfie Verification (App SDK)
Identity Verification (Mobile HTML5)
Identity Verification (App SDK)
Other Guide
API Documentation
History
Introduction
API Category
Making API Requests
Selfie Verification (Pure API) APIs
Selfie Verification (App SDK) APIs
Identity Verification (App SDK) APIs
Identity Verification(Mobile HTML5) APIs
AI Face Shield (Pure API) APIs
Other APIs
Data Types
Error Codes
FAQs
Contact Us
Glossary
eKYC Policy
Privacy Policy
Data Processing And Security Agreement
Service Level Agreement

Integration Process

PDF
Focus Mode
Font Size
Last updated: 2025-01-14 19:41:39
This article describes the overall access process of liveness face comparison in API mode. You can integrate it using any language you are familiar with because this API is language independent. However, before using API to integrate liveness face comparison services, you'd better be able to read and understand Connecting to Tencent Cloud API, which tells you how to use Tencent Cloud SDK to simplify the API access process. In this article, we only demonstrate how to integrate our APIs using Java API SDK.

Preparing for Access

Register a Tencent Cloud enterprise account. Refer to Signing Up.
Complete the enterprise identity verification. Refer to Enterprise Identity Verification Guide.
Log in to FaceID console to Open Service.
Obtain API access key.

Introducing Tencent Cloud API SDK

<dependency>
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java-intl-en</artifactId>
<version>3.0.798</version>
</dependency>

Initializing and Configuring API SDK Client

// Instantiate an authentication object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as the input parameters
Credential cred = new Credential("secretId", "secretKey");

// Instantiate the client object of the requested product
ClientProfile clientProfile = new ClientProfile();
clientProfile.setSignMethod(ClientProfile.SIGN_TC3_256);

FaceidClient client = new FaceidClient(cred, "ap-singapore", clientProfile);

Calling the CompareFaceLiveness API

// Step 1: Instantiate the request object and provide necessary parameters
CompareFaceLivenessRequest request = new CompareFaceLivenessRequest();
request.setLivenessType("SILENT");
request.setImageBase64(getBase64(cmd.getOptionValue(IMAGE_PATH)));
request.setVideoBase64(getBase64(cmd.getOptionValue(VIDEO_PATH)));

// Step 2: Call the Tencent Cloud API through FaceIdClient
CompareFaceLivenessResponse response = client.CompareFaceLiveness(request);

// Step 3: Process the Tencent Cloud API response and construct the return object
System.out.println(CompareFaceLivenessResponse.toJsonString(response));

Usage Example

You can view full sample source code at GitHub repository:

API Documentation

You can view full API documentation on Tencent Cloud official website:


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback