支持姓名、身份证号两要素验证,以及姓名、身份证号、人脸图片三要素验证,与权威数据源进行比对验真,判断用户是否为「本人」
无参数
无参数
名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
secret_key | string | true | 用户授权key |
secret_code | string | true | 接口编号 |
secret_sign | string | true | 加密签名:md5(secret_key+secret_secret)转大写 |
image | string | true | 图片信息(总数据大小应小于10M),图片上传方式根据image_type来判断 |
imageType | string | true | 图片类型 BASE64:图片的base64值,base64编码后的图片数据,编码后的图片大小不超过2M;图片尺寸不超过1920*1080 |
idCardNum | string | true | 身份证号码 |
name | string | true | 姓名 |
qualityContro | string | true | 图片质量控制 NONE: 不进行控制 LOW:较低的质量要求 NORMAL: 一般的质量要求 HIGH: 较高的质量要求 默认 NONE |
livenessControl | string | true | 活体检测控制 NONE: 不进行控制 LOW:较低的活体要求(高通过率 低攻击拒绝率) NORMAL: 一般的活体要求(平衡的攻击拒绝率, 通过率) HIGH: 较高的活体要求(高攻击拒绝率 低通过率) 默认NONE |
curl http://cloud.kuaidi100.com/api -X POST -d \
"secret_key=***&secret_code=33e7e61c95234dbe9b7f19680f227ae6&secret_sign=md5(***)&image=&imageType=&idCardNum=&name=&qualityContro=&livenessControl="
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
public class CloudDemo {
public static void main (String[] args) {
CloudDemo cloudDemo = new CloudDemo();
Map params = new HashMap();
params.put("secret_key", "***");
params.put("secret_code", "33e7e61c95234dbe9b7f19680f227ae6");
params.put("secret_sign", "md5(***)");
params.put("image", "");
params.put("imageType", "");
params.put("idCardNum", "");
params.put("name", "");
params.put("qualityContro", "");
params.put("livenessControl", "");
cloudDemo.post(params);
}
public String post(Map params) {
StringBuilder response = new StringBuilder("");
BufferedReader reader = null;
try {
StringBuilder builder = new StringBuilder();
for (Map.Entry param : params.entrySet()) {
if (builder.length() > 0) {
builder.append('&');
}
builder.append(URLEncoder.encode(param.getKey(), "UTF-8"));
builder.append('=');
builder.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8"));
}
byte[] bytes = builder.toString().getBytes("UTF-8");
URL url = new URL("http://cloud.kuaidi100.com/api");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(5000);
conn.setReadTimeout(5000);
conn.setRequestMethod("POST");
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("Content-Length", String.valueOf(bytes.length));
conn.setDoOutput(true);
conn.getOutputStream().write(bytes);
reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String line = "";
while ((line = reader.readLine()) != null) {
response.append(line);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (null != reader) {
reader.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return response.toString();
}
}
class MD5Utils { private static MessageDigest mdigest = null;
private static char digits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
private static MessageDigest getMdInst() {
if (null == mdigest) {
try {
mdigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
return mdigest;
}
public static String encode(String s) {
if(null == s) {
return "";
}
try { byte[] bytes = s.getBytes();
getMdInst().update(bytes);
byte[] md = getMdInst().digest();
int j = md.length;
char str[] = new char[j * 2];
int k = 0;
for(int i = 0; i < j; i++) {
byte byte0 = md[i];
str[k++] = digits[byte0 >>> 4 & 0xf];
str[k++] = digits[byte0 & 0xf];
}
return new String(str);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
暂无示例
<?php
$params = "";
$params .= 'secret_key=***'.'&';
$params .= 'secret_code=33e7e61c95234dbe9b7f19680f227ae6'.'&';
$params .= 'secret_sign=md5(***)'.'&';
$params .= 'image='.'&';
$params .= 'imageType='.'&';
$params .= 'idCardNum='.'&';
$params .= 'name='.'&';
$params .= 'qualityContro='.'&';
$params .= 'livenessControl='.'&';
$params .= substr($params, 0, -1);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, 'http://cloud.kuaidi100.com/api');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
echo $result;
?>
# coding = utf-8
import sys,os
import requests,json,hashlib
params = {}
params['secret_key'] = '***'
params['secret_code'] = '33e7e61c95234dbe9b7f19680f227ae6'
params['secret_sign'] = 'md5(***)'
params['image'] = ''
params['imageType'] = ''
params['idCardNum'] = ''
params['name'] = ''
params['qualityContro'] = ''
params['livenessControl'] = ''
result = requests.post('http://cloud.kuaidi100.com/api', params)
print(result.text)
无参数
{
"code":200,
"message":"success",
"data":{
"errorCode":0,
"errorMessage":"SUCCESS",
"taskId":"7965898435947", //日志id
"result":{
"score":"100" //与公安小图相似度可能性,用于验证生活照与公安小图是否为同一人,有正常分数时为[0~100],推荐阈值80,超过即判断为同一人
}
}
}
{
"code":400
}
状态码 | 状态码信息 | 描述 |
---|---|---|
200 | 成功 |
在投资理财、保险理赔、证券交易等安全性要求高的金融场景,运用人脸核身方案,将线下业务转为线上自助模式,满足远程开户、保险回执单等业务需求。同时可以辅助密码找回等密保措施,降低用户身份信息被恶意篡改、顶替冒用等风险,提升信息安全管理
稳定服务保障
提供企业级稳定、精确的大流量服务,拥有毫秒级识别响应能力、弹性灵活的高并发承载,可靠性保障高达99.99%
全面开放,适配多种应用场景
质量控制参数说明
不同的控制度下所对应的质量控制阈值,如果检测出来的质量信息某一项不符合控制阈值的要求,则会返回错误信息。
控制度 | left_eye | right_eye | nose | mouth | left_cheek | right_cheek | chin_contour | illumination | blurdegree | completeness |
LOW | 0.8 | 0.8 | 0.8 | 0.8 | 0.8 | 0.8 | 0.8 | 20 | 0.8 | 0 |
NORMAL | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 0.6 | 40 | 0.6 | 0 |
HIGH | 0.2 | 0.2 | 0.2 | 0.2 | 0.2 | 0.2 | 0.2 | 100 | 0.2 | 1 |