tencent cloud

全部产品文档
人脸核身
连接腾讯云 API 接口
最后更新时间:2023-06-06 16:22:17
连接腾讯云 API 接口
最后更新时间: 2023-06-06 16:22:17
腾讯云 API 3.0集成支持多种编程语言的 SDK,让您调用 API 更简单,云 API 支持就近地域接入,本产品就近地域接入域名为 faceid.tencentcloudapi.com ,也支持指定地域域名访问,例如新加坡地域的域名为 faceid.ap-singapore.tencentcloudapi.com。
推荐使用就近地域接入域名。根据调用接口时客户端所在位置,会自动解析到最近的某个具体地域的服务器。例如在新加坡发起请求,会自动解析到新加坡的服务器,效果和指定 faceid.ap-singaporef.tencentcloudapi.com 是一致的。
注意:
1. 对时延敏感的业务,建议指定带地域的域名。
2. 域名是 API 的接入点,并不代表产品或者接口实际提供服务的地域。产品支持的地域列表请在调用方式/公共参数文档中查阅,接口支持的地域请在接口文档输入参数中查阅
你可以选择你所熟悉的语言进行编码,这部分将使用golang语言作为示例演示如何将腾讯云SDK继承到自己的服务端模块中。

环境依赖

1. Go1.9或者更高版本,并且必须正确设置必要的环境变量,比如GOPATH
2. 使用前请阅读流程指引开通人脸核身产品
3. 按照获取秘钥指引操作获取SecretId和SecretKey

安装

通过 go get 安装(推荐)

推荐使用语言自带的工具安装SDK。
go get -u github.com/tencentcloud/tencentcloud-sdk-go-intl-en

通过源码安装

Github代码托管页面下载最新代码,解压安装到$GOPATH/src/github.com/tencentcloud目录下。

集成到服务端

腾讯云SDK安装完成之后,可以通过import指令将SDK集成服务端,示例代码如下:
package main

import (
"fmt"
cloud "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common"
"github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/profile"
faceid "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/faceid/v20180301"
)

func main() {
// Instantiate a client configuration object. You can specify the timeout period and other configuration items
prof := profile.NewClientProfile()
prof.HttpProfile.ReqTimeout = 60
// TODO replace the SecretId and SecretKey string with the API SecretId and SecretKey
credential := cloud.NewCredential("SecretId", "SecretKey")
// Instantiate the client object of the requested faceid
FaceIdClient, _ := faceid.NewClient(credential, "ap-singapore", prof)

// Instantiate the request object and provide necessary parameters
request := faceid.NewGetFaceIdTokenIntlRequest()
var SecureLevel = "4"
request.SecureLevel = &SecureLevel
// Call the Tencent Cloud API through FaceIdClient
response, _ := FaceIdClient.GetFaceIdTokenIntl(request)
// Process the Tencent Cloud API response
fmt.Println("response: ", *response.Response.SdkToken)
}


本页内容是否解决了您的问题?
您也可以 联系销售 提交工单 以寻求帮助。

文档反馈

联系我们

联系我们,为您的业务提供专属服务。

技术支持

如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

7x24 电话支持
中国香港
+852 800 906 020 (免费)
美国
+1 844 606 0804 (免费)
英国
+44 808 196 4551 (免费)
加拿大
+1 888 605 7930 (免费)
澳大利亚
+61 1300 986 386 (免费)
EdgeOne 热线
+852 300 80699
更多本地服务热线陆续新增中