tencent cloud

人脸核身

动态与公告
产品动态
产品公告
产品简介
产品概述
产品优势
应用场景
购买指南
计费概述
购买方式
欠费说明
退费说明
接入文档
开始集成
活体人脸比对(纯 API)接入指引
活体人脸比对 (移动端H5) 接入指引
活体人脸比对 (App SDK) 接入指引
卡证活体人脸比对(移动端 H5)接入指引
卡证活体人脸比对(App SDK)接入指引
其他指引
API 文档
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
常见问题
联系我们
词汇表
eKYC 政策
隐私协议
数据处理和安全协议
服务等级协议

接入流程说明

PDF
聚焦模式
字号
最后更新时间: 2023-11-29 15:59:56
本文介绍活体人脸比对纯 API 模式整体接入流程,该 API 与语言无关,您可以使用任何您熟悉的语言进行集成。但是在使用 API 集成活体人脸比对服务之前,您最好能够阅读理解 连接腾讯云 API 接口,它可以告诉你如何使用腾讯云 SDK 以简化 API 接入的流程。在这篇文章中,我们仅使用 Java API SDK 演示如何集成我们的 API。

接入准备

注册腾讯云企业账号,请参见 注册指引
完成企业实名认证,请参见 企业实名指引
登录慧眼控制台 开通服务
获取 API 访问 秘钥

引入腾讯云 API SDK

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

API SDK 客户端初始化以及配置

// 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);

用 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));

使用示例

可以在 GitHub 仓库查看完整的示例源码:

API 文档

可以在腾讯云官网查看完整的 API 接口文档:

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈