翔云-名片识别API开发文档
接口说明接口地址,图片为base64流:https://netocr.com/api/recogliu.do图片为file格式:https://netocr.com/api/recog.do(注:调用图片为base64流接口时传参数img,调用图片为file格式接口传参数file)接口调用方法:post3、请求参数名称类型必填说明
imgString是上传的文件(图片的base64流)
fileMultipartFile是上传的文件(上传文件的字段名必须是“file”)
keyString是用户ocrKey
secretString是用户ocrSecrert
typeIdInteger是识别类型:20
formatString是返回格式(xml或者json),如果format为空,则默认返回xml
识别结果字符串
<status/>标签显示了识别状态,大于等于“0”代表识别成功【“0”代表查询成功,“1”代表未查到数据,“2”代表查询失败】,小于“0”代表识别失败,失败的原因在<value/>中描述。调用错误码
status值描述
-1用户已屏蔽
-2用户key或secret验证错误
-3服务次数不足
-4用户未找到
-6系统异常
-7图片不可为空,参数不可为空
-8类型错误
识别错误码1
status值描述
-1识别失败
识别错误码2
value值描述
BusinessCardRecogImage1加载图像失败
BusinessCardRecogImage2识别失败
BusinessCardRecogImage授权相关错误
调用方式(java客户端基于httpclient4.3)
1.依赖库: \java客户端\httpClient4.3库\,如图:file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml17972\wps1.png 2.示例程序代码详见: \java客户端\httpClientDemo\中的Client类,如图:file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml17972\wps2.png 在main方法定义参数,并传入 doPost(url, file, key, secret, typeId, format) 方法中。如图:file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml17972\wps3.jpg 执行main方法返回识别结果如下:{ "message":{ "status":0, "value":"识别完成" }, "cardsinfo":[ { "type":"20", "items":[ { "nID":"0", "index":"0", "desc":"姓名", "content":"" }, { "nID":"1", "index":"0", "desc":"职务/部门", "content":"" }, { "nID":"2", "index":"0", "desc":"手机", "content":"" }, { "nID":"3", "index":"0", "desc":"公司", "content":"" }, { "nID":"3", "index":"1", "desc":"公司", "content":"" }, { "nID":"3", "index":"2", "desc":"公司", "content":"" }, { "nID":"4", "index":"0", "desc":"地址", "content":"" }, { "nID":"5", "index":"0", "desc":"电话", "content":"" }, { "nID":"6", "index":"0", "desc":"传真", "content":"" }, { "nID":"7", "index":"0", "desc":"电子邮箱", "content":"" }, { "nID":"8", "index":"0", "desc":"网址", "content":"" }, { "nID":"9", "index":"0", "desc":"邮编", "content":"" } 剩余条数查询接口(所有产品类型)
接口地址:https://netocr.com/api/accountLift.do
接口调用方法:post
接口接收参数:
String key:用户ocrKey
String secret:用户ocrSecret
String format:返回格式(xml或者json),如果format为空,则默认返回xml
页:
[1]