Skip to content

2.3.1 OCR识别(可选)

工具类接口;提供OCR识别的功能

图片来源场景:拍照 & 图片上传
图像内存大小要求:大于 50KB 且小于 1MB,建议 200KB 以上
图像分辨率要求:大于 320 x 320 且小于 1920 x 1920,建议短边大于 600

建议:拍照界面增加证件引导框;图片上传时,图片格式可以为 png、jpg、jpeg,原图片大小不限制,但是上传前需要按照上述大小和分辨率对图片进行压缩处理,确保最终上传的图像符合要求。

  • 接口提供方: 流量承接方(KN)
  • 接口调用方: 流量提供方
  • method: util_ocr

请求参数

参数类型必选说明备注
phonestringN用户手机号10位;
phone&receiver_user_id&
provider_user_id传其中一个即可
receiver_user_idstringN流量承接方的用户id不超过32位;
phone&receiver_user_id&
provider_user_id传其中一个即可
provider_user_idstringN流量提供方的用户id不超过32位;
phone&receiver_user_id&
provider_user_id传其中一个即可
image_typestringY照片类型3.1.10
image_urlstringY照片地址-

响应参数

参数类型必选说明备注
statusintY业务状态码3.3.9
resultobjectNocr识别结果-

result

参数类型必选说明备注
cidstringN身份证证件号-
date_of_birthstringN生日格式:2006-01-02
first_name_enstringNfirstName(英文)-
last_name_enstringNlastName(英文)-
full_name_thstringN全名(泰文)-

请求参数示例

json
{
    "phone": "0612345678",
    "image_type": "cid_front",
    "image_url": "https://abc.com/def"
}

响应参数示例

json
{
    "code": 0,
    "message": "success",
    "data": {
        "status": 22000,
        "result": {
            "cid": "1819900012345",
            "date_of_birth": "1978-01-24",
            "first_name_en": "Mr.Wanchai",
            "last_name_en": "Bondach",
            "full_name_th": "นาย วันชัย บุญเดช"
        }
    }
}