Appearance
2.3.1 OCR识别(可选)
工具类接口;提供OCR识别的功能
图片来源场景:拍照 & 图片上传
图像内存大小要求:大于 50KB 且小于 1MB,建议 200KB 以上
图像分辨率要求:大于 320 x 320 且小于 1920 x 1920,建议短边大于 600
建议:拍照界面增加证件引导框;图片上传时,图片格式可以为 png、jpg、jpeg,原图片大小不限制,但是上传前需要按照上述大小和分辨率对图片进行压缩处理,确保最终上传的图像符合要求。
- 接口提供方: 流量承接方(KN)
- 接口调用方: 流量提供方
- method: util_ocr
请求参数
| 参数 | 类型 | 必选 | 说明 | 备注 |
|---|---|---|---|---|
| phone | string | N | 用户手机号 | 10位;phone&receiver_user_id&provider_user_id传其中一个即可 |
| receiver_user_id | string | N | 流量承接方的用户id | 不超过32位;phone&receiver_user_id&provider_user_id传其中一个即可 |
| provider_user_id | string | N | 流量提供方的用户id | 不超过32位;phone&receiver_user_id&provider_user_id传其中一个即可 |
| image_type | string | Y | 照片类型 | 见 3.1.10 |
| image_url | string | Y | 照片地址 | - |
响应参数
| 参数 | 类型 | 必选 | 说明 | 备注 |
|---|---|---|---|---|
| status | int | Y | 业务状态码 | 见 3.3.9 |
| result | object | N | ocr识别结果 | - |
result
| 参数 | 类型 | 必选 | 说明 | 备注 |
|---|---|---|---|---|
| cid | string | N | 身份证证件号 | - |
| date_of_birth | string | N | 生日 | 格式:2006-01-02 |
| first_name_en | string | N | firstName(英文) | - |
| last_name_en | string | N | lastName(英文) | - |
| full_name_th | string | N | 全名(泰文) | - |
请求参数示例
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": "นาย วันชัย บุญเดช"
}
}
}