票据分类识别
<p>[TOC]</p>
<h2>简要描述</h2>
<ul>
<li>
<p>票据分类</p>
<h2>请求URL</h2>
</li>
<li>票据识别 <a href="https://www.textin.com/document/general_receipt_classify">https://www.textin.com/document/general_receipt_classify</a></li>
</ul>
<h2>请求方式</h2>
<ul>
<li>Post</li>
<li>请求体的数据格式为文件的二进制流,非 FormData 或其他格式。文件大小不超过 10M,图像宽 高须介于 20 和 10000(像素)之间</li>
</ul>
<h2>请求参数</h2>
<ul>
<li>
<p>需要配置请求头</p>
<p>请求体为:Content-Type: application/octet-stream,为文件的二进制流
在postman中,选择body为binary</p>
</li>
<li>注册的1000次使用</li>
</ul>
<table>
<thead>
<tr>
<th style="text-align: left;">可以用的</th>
<th style="text-align: left;">值</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">x-ti-app-id</td>
<td style="text-align: left;">915a6127a44de7e068c1583405c2510a</td>
</tr>
<tr>
<td style="text-align: left;">x-ti-secret-code</td>
<td style="text-align: left;">08144fbc51a5f67f539e109b0a727836</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th style="text-align: left;">Header</th>
<th style="text-align: left;">是否必选</th>
<th style="text-align: left;">参数类型</th>
<th>说明描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">x-ti-app-id</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-app-id</td>
</tr>
<tr>
<td style="text-align: left;">x-ti-secret-code</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-secret-code</td>
</tr>
</tbody>
</table>
<ul>
<li>请求参数</li>
</ul>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名称</th>
<th style="text-align: left;">是否必选</th>
<th style="text-align: left;">参数类型</th>
<th>说明描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">img</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">jpg/png/bmp/pdf/tiff等</td>
<td>上传的图片</td>
</tr>
</tbody>
</table>
<h2>返回参数说明</h2>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=42fcbf51930a9a1558ea039b35227452&file=file.jpg" alt="" /></p>
<h2>返回示例</h2>
<pre><code> {
"code": 200,
"result": {
"rotated_image_height": 1080,
"image_angle": 0,
"type_description": "增值税普通发票",
"rotated_image_width": 1440,
"type": "vat_common_invoice"
},
"cost_time": 570,
"message": "success"
}</code></pre>
<h2>备注</h2>
<p>测试代码</p>
<pre><code> let type=ref()
let typedescription=ref()
function getType() {
axios({
method: "post",
headers: {
"Content-Type": "application/octet-stream",
"x-ti-app-id": "915a6127a44de7e068c1583405c2510a",
"x-ti-secret-code": "08144fbc51a5f67f539e109b0a727836",
},
url: "https://api.textin.com/robot/v1.0/api/general\_receipt\_classify",
data: imgFile,
})
.then(function (res) {
console.log("success", res.data);
type.value=res.data.result.type
typedescription.value=res.data.result.type_description
})
.catch(function (error) {
console.log("error");
});
}</code></pre>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=40646595af20acb1161d1e99ddb467b7&file=file.jpg" alt="" /></p>