更新时间:2019-11-19 12:02
购买页面:https://market.aliyun.com/products/57124001/cmapi029975.html
调用地址:在购买页面-API接口查看
模板设计页面: https://ocr.data.aliyun.com
输入格式(单模板):
{
"image": "图片二进制数据的base64编码",
"configure": "{\"template_id\":\"95d551ee-8b2b-4ad0-89a9-ed13417f4a781536146904\"}"
}
输入格式(多模板自动匹配):
基于关键字
{
"image": "图片二进制数据的base64编码",
"configure":{"template_list": [
{"template_id": "fc7b375c-8e98-48ef-81fb-ec3843b2fb371534902155", #星巴克的模板id
"cond": {"and": [{"or": [{"include": "星巴克"},
{"include":"starbuck"}]
},
{"exclude":"Costa"}]}
},
{"template_id": "7bc26bd7-41ad-4145-9f5a-4af21b26de9a", #costa的模板id
"cond": {"include":"costa"}
}]
}
}
自动匹配
{
"image": "图片二进制数据的base64编码",
"configure":{"template_list": [
"fc7b375c-8e98-48ef-81fb-ec3843b2fb371534902155", #星巴克的模板id
"7bc26bd7-41ad-4145-9f5a-4af21b26de9a", #costa的模板id
]
}
}
输出格式(不带表格的):
{
"config_str":"{\"template_id\":\"95d551ee-8b2b-4ad0-89a9-ed13417f4a781536146904\"}",
"items":{"cash_id":":11535001", #key-value组合,key是用户在界面上填写的
"cash_name":":李伟",
"change":"¥0.00",
"date":":2018.03.16 16:46",
"drop":"¥-0.10",
"num":":2",
"pay":"¥65.50",
"sell_type":"外带",
"seller":"24662",
"shop_name":"TEL:0571-5697229",
"total":"¥65.60"
},
"request_id":"20180723151536_fa0edbe7408fc589b93119f7a53a1260",
"success":true
}
输出格式(带表格的输出):
{
"config_str":"{\"template_id\":\"dd3ada93-c6ed-4427-8e0b-fbdebad614061532347130\"}",
"items":{
"item_no" : "1313131313",
"mail" : "daigou@gmail.com",
"name" : "代购小哥",
"nation" : "美国",
"phone" : "987654321",
"table0" : { #table0是用户在界面上填写的表格名称
#labels是用户在界面上填写的, 表格每一列的名称, values是每一行的值
#一行的数组和labels是一一对应的关系
“labels":["brand", "model", "name", "quantity", "standard", "total"]
"values":[["Iphone","8p","手机","3","128G","15000rmb"],
["戴森","V8","吸尘器","1","Absolute","3500元"],
["","","","","",""],
["","","","","",""],
["","","","","",""]
]
}
}
}
正常返回:http_status = 200
错误代码:图片输入错误或者算法错误, http_status = 400
没有设置template_json, http_status = 452
没有设置锚点, http_status = 453
没有设置识别内容, http_status = 454
没有对应的template_id, http_status = 455
在文档使用中是否遇到以下问题
更多建议
匿名提交