接入技术服务

证件分类

功能描述

证件分类

请求URL

https://api.textin.com/robot/v1.0/api/cert_classify

HTTP请求方法(Method)

HTTP POST

请求头说明(Request Headers)

请在HTTP请求中添加以下自定义标头(Header)。

header 名
x-ti-app-id 请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-app-id
x-ti-secret-code 请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-secret-code

URL参数(Parameters)

URL参数指以 {参数名}={参数值} 形式拼接到 URL 上的键值对。它以 ? 开头,不同参数之间使用 & 连接。形如 ?p1=v1&p2=v2
参数名 数据类型 是否必填 允许的值 描述
split_id_card integer 1, 0

是否拆分身份证分类结果,0为不拆分,1为拆分, 默认为0

请求体说明(Request Body)

支持以下两种请求格式

1. Content-Type: application/octet-stream

要上传的图片,目前支持jpg, png, bmp, pdf, tiff, webp, 单帧gif等大部分格式.

请注意,请求体的数据格式为本地文件的二进制流,非 FormData 或其他格式。文件大小不超过 10M,图像宽高须介于 20 和 10000(像素)之间。

2. Content-Type: text/plain

请求体的数据格式为文本,内容为在线文件的URL链接(支持http以及https协议)。在线文件大小不超过 10M,图像宽高须介于 20 和 10000(像素)之间。

响应体说明 (Response)

Content-Type: application/json

JSON结构说明如下:

说明:所有接口响应中均包含字段 x_request_id(string类型),作为请求的唯一标识。

字段名 类型 描述
code integer 错误码,详见“错误码说明”
message string

错误信息

duration number

接口耗时计算,时间单位是毫秒(ms)

result object
+ image_angle integer

图片角度,指原图需要经过顺时针旋转多少度,才能得到正方向的图片

+ rotated_image_width integer

正方向时图片的宽

+ rotated_image_height integer

正方向时图片高

+ type string
  • other: 其他
  • bank_card: 银行卡
  • business_card: 名片
  • hongkong_idcard: 香港身份证
  • social_security_cards: 社保卡
  • drive_license: 驾驶证
  • vehicle_license: 行驶证
  • family_register: 户口本
  • passport: 护照
  • marriage_certificate: 结婚证
  • divorce_certificate: 离婚证
  • house_property_owner_ship: 房产证
  • real_estate: 不动产证
  • business_license: 营业执照
  • opening_license: 开户许可证
  • organization_certificate: 组织机构代码证
  • vehicle_certificate: 车辆合格证
  • vehicle_registration: 车辆登记证
  • id_card_back: 身份证国徽面
  • tax_certificate: 税务登记证
  • id_card_front: 身份证头像面
  • id_card_front_and_back: 身份证或临时身份证
  • id_card: 身份证
  • macau_id_card: 澳门身份证
+ image_angle integer

图片角度,指原图需要经过顺时针旋转多少度,才能得到正方向的图片

+ rotated_image_width integer

正方向时图片的宽

+ rotated_image_height integer

正方向时图片高

+ type string
  • other: 其他
  • bank_card: 银行卡
  • business_card: 名片
  • hongkong_idcard: 香港身份证
  • social_security_cards: 社保卡
  • drive_license: 驾驶证
  • vehicle_license: 行驶证
  • family_register: 户口本
  • passport: 护照
  • marriage_certificate: 结婚证
  • divorce_certificate: 离婚证
  • house_property_owner_ship: 房产证
  • real_estate: 不动产证
  • business_license: 营业执照
  • opening_license: 开户许可证
  • organization_certificate: 组织机构代码证
  • vehicle_certificate: 车辆合格证
  • vehicle_registration: 车辆登记证
  • id_card_back: 身份证国徽面
  • tax_certificate: 税务登记证
  • id_card_front: 身份证头像面
  • id_card_front_and_back: 身份证或临时身份证
  • id_card: 身份证
  • macau_id_card: 澳门身份证
+ type_description string

分类中文描述

cost_time number

接口耗时计算,时间单位是毫秒(ms)

JSON结构示例

{"code":200,"message":"success","cost_time":100,"result":{"image_angle":0,"rotated_image_width":100,"rotated_image_height":100,"type":"","type_description":""},"duration":100}

错误码说明

错误码 描述
40101 x-ti-app-id 或 x-ti-secret-code 为空
40102 x-ti-app-id 或 x-ti-secret-code 无效,验证失败
40103 客户端IP不在白名单
40003 余额不足,请充值后再使用
40004 参数错误,请查看技术文档,检查传参
40007 机器人不存在或未发布
40008 机器人未开通,请至市场开通后重试
40301 文件类型不支持,接口会返回实际检测到的文件类型,如“当前文件类型为.gif”
40302 上传文件大小不符,文件大小不超过 10M
40303 文件类型不支持
40304 图片尺寸不符,图像宽高须介于 20 和 10000(像素)之间
40305 识别文件未上传
40306 QPS超过限制,收到此状态码时请勿重试,持续请求可能触发IP流控,如需扩容请联系商务
40400 无效的请求链接,请检查链接是否正确
30203 基础服务故障,请稍后重试
500 服务器内部错误
技术交流群
技术交流群

联系我们