接入文档
FaceID高级版
H5接入
API调用
回调说明
回调说明
# 1、Return_url 和 Notify_url 回调
说明:客户在GetToken方法中传入的 return_url 和 notify_url 会在完成 FaceID Lite 人脸核身后被系统回调。其中
return_url:可通过设置action_http_method选择Post方法或者Get方法回调,直接通过页面跳转实现;
notify_url:会通过Post方法回调,由FaceID后台发起调用。出于安全性考虑,FaceID验证服务对服务器端回调端口有白名单要求,支持的端口有:443,5000,16003,8883,8028(如果回调地址不是HTTPS的,则推荐进行签名校验)。
1.1、采用Post回调的内容为一个form格式数据,具体的内容如下表所示:
字段 | 类型 | 说明 | 示例 |
---|---|---|---|
data | String | 人脸核身返回值(json格式),具体见返回值说明 | |
sign | String | 数据段的签名,签名方法为 sign = sha1(API_SECRET + json_data),其中sha1返回的字符均为小写 | ac041f49940c5afb2640a251633a8029ae69c1d5 |
# 返回值说明
返回值 | 类型 | 说明 | 示例 | return_url | notify_url |
---|---|---|---|---|---|
status | String |
表示目前FaceID Lite的使用状态:
|
"OK" | √ | √ |
fail_reason | String |
当“get_fail_reason”=1时,可获取“WEBRTC_UNSUPPORTED”失败原因
|
“NETWORK_ERROR” | √ | √ |
biz_info | Json |
包含:biz_id, biz_no, biz_extra_data
|
{
"biz_extra_data": "...", "biz_id": "1462259748, 52b13fb5-8dfb-4537 -a62b-a641d5e929f1", "biz_no": "cc47190f-5502-44a2 -ab74-ea4f0f649f61" } |
√ | √ |
idcard _info |
Json |
身份证识别的结果,此字段在idcard_mode = 0时不返回;如果用户中途中断了活体流程,则此字段也不返回
内容包括:
|
{
"idcard_mode": "1", "idcard_uneditable_field": "idcard_number, idcard_valid_date", "idcard_number": "xxxxxx19910602xxxx", "idcard_name": "陈AB", "idcard_valid_date": "2010.11.13-2020.11.13", "idcard_issued_by": "北京市公安局", "front_side": { "ocr_result": { "address": "北京市海淀区XXXX", "birthday": { "day": "2", "month": "6", "year": "1991" }, "gender": "男", "id_card_number": "xxxxxx19910602xxxx", "name": "陈XX", "race": "汉", "legality": { "ID Photo": 0.855, "Temporary ID Photo ":0, "Photocopy": 0.049, "Screen": 0.096, "Edited": 0 } }, "upload_times": 1 }, "back_side": { "ocr_result": { "issued_by": " 北京市公安局海淀分局", "valid_date": "2010.11.13-2020.11.13", "legality": { "ID Photo": 0.855, "Temporary ID Photo ": 0, "Photocopy": 0.049, "Screen": 0.096, "Edited": 0 } }, "upload_times": 2 }, "ocr_front_quality": { "gender": { "quality": 0.925, "logic": 0, "result": "男" }, "address": { "quality": 0.958, "logic": 0, "result": "xxx" }, "idcard_number": { "quality": 0.995, "logic": 0, "result": "xxxx" }, "name": { "quality": 0.996, "logic": 0, "result": "张三" }, "birth_month": { "quality": 0.971, "logic": 0, "result": "8" }, "birth_day": { "quality": 0.975, "logic": 0, "result": "31" }, "nationality": { "quality": 0.959, "logic": 0, "result": "汉" }, "birth_year": { "quality": 0.942, "logic": 0, "result": "1996" } }, "ocr_back_quality": { "issued_by": { "quality": 0.994, "logic": 0, "result": "xxxxx" }, "valid_date_end": { "quality": 0.995, "logic": 0, "result": "xxxx" }, "valid_date_start": { "quality": 0.995, "logic": 0, "result": "20140515" } } } |
√ | √ |
liveness _result |
Json |
活体检测结果;如果用户中途中断了活体流程,则此字段不返回
|
{
"result": "PASS/FAIL", "procedure_type": "will", "details": { "UPLOAD_TIMES": 5, "FACE_NOT _FOUND": 0, "LOW_FACE _QUALITY": 0, "INVALID_VIDEO _DURATION": 1, "SR_ERROR": 2, "NOT_SYNCHRONIZED": 1, "VIDEO_FORMAT _UNSUPPORTED": 0, "NO_AUDIO": 0 }, "face_genuineness": { "synthetic_face _confidence": 0.88, "synthetic_face _threshold": 0.5, "mask_confidence": 0.32, "mask_threshold": 0.5, "screen_replay _confidence": 0, "screen_replay _threshold": 0.5 } } |
√ | √ |
verify _result |
Json |
人脸比对结果;如果用户中途中断了活体流程,则此字段不返回
|
{
"verify_time": 1462259763, "result_faceid": { "confidence": 68.918, "thresholds": { "1e-3": 64, "1e-4": 69, "1e-5": 74, "1e-6": 79.9 } }, "result_ref1": { "confidence": 68.918, "thresholds": { "1e-3": 64, "1e-4": 69, "1e-5": 74, "1e-6": 79.9 } }, "result_idcard_photo": { "confidence": 68.918, "thresholds": { "1e-3": 64, "1e-4": 69, "1e-5": 74, "1e-6": 79.9 } }, "result_idcard _datasource": { "confidence": 68.918, "thresholds": { "1e-3": 64, "1e-4": 69, "1e-5": 74, "1e-6": 79.9 } }, "id_exceptions": { "id_attacked": 0, "id_photo_ monochrome": 0 } } |
√ | √ |
will_result | Json |
意愿活体结果;未开通意愿核身高级版、意愿比对高级版SKU或procedure_type不为will,则此字段不返回
|
通过 "will_result": [ { "will_error_message": "", "result": "PASS" }] 失败" will_result": [ { "result": "FAIL", "will_error_message": "ACTION_FAIL" }] |
√ | √ |
multifaces_tag | String |
仅当return_multifaces_tag参数为1时,返回此字段
|
0 | √ | √ |
1.2、采用Get回调时会在return_url地址拼接biz_id参数,请提取地址中拼接的biz_id用于作为get_result的入参。
示例:
●https://yourdomainname/xxx?biz_id=xxx
●https://yourdomainname/xxx?xxx=xxx&biz_id=xxx
●https://yourdomainname/xxx?biz_id=xxx&xxx=xxx#xxx
参数 | 类型 | 说明 | 示例 |
---|---|---|---|
biz_id | String | 通过get_token返回的活体业务编号 | 146225974852b13fb5-8dfb-4537-a62b-a641d5e929f1 |
该文档未解决您的疑问?查看常见问题