curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/file/upload/sync \
--header 'Content-Type: multipart/form-data' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--form file='@example-file'{
"code": 200,
"msg": "<string>",
"result": {
"total": 100,
"page": 1,
"page_size": 20,
"files": [
{
"id": 202412190001,
"name": "invoice.pdf",
"format": "<string>",
"recognition_status": 0,
"verification_status": 0,
"category": "invoice",
"task_id": 202412190001,
"task_type": 1,
"batch_number": 202412190001,
"failure_causes": "<string>",
"pages": [
{
"page": 1,
"angle": 0,
"width": 1024,
"height": 1024,
"dpi": 144
}
],
"data": {
"fields": [
{
"key": "发票代码",
"identifier": "发票代码标识",
"value": "3100231130",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "发票号码",
"value": "28737000",
"identifier": "发票号码标识",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"items": [
[
{
"key": "货物劳务名称",
"value": "*电子计算机*微型计算机主机",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "规格型号",
"value": "DMS-SC68",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
[
{
"key": "货物劳务名称",
"value": "*机械计算机*巨型计算机主机",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "规格型号",
"value": "AN/FSQ-7",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
]
],
"tables": [
{
"tableName": "table1",
"tableType": 0,
"items": [
[
{
"key": "<string>",
"identifier": "<string>",
"value": "<string>",
"textInLines": [
{
"angle": 0,
"pos": [
1
],
"page": 1,
"text": "文本内容",
"char_pos": [
[
1
]
]
}
],
"position": [
{
"page": 123,
"vertices": [
123
]
}
],
"index": 123
}
]
]
}
],
"stamps": [
{
"angel": 0,
"page": 0,
"text": "全国统一发票监制章",
"type": "其他",
"color": "红色",
"shape": "椭圆章",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
},
{
"angel": 0,
"page": 0,
"text": "税务局章",
"type": "其他",
"color": "红色",
"shape": "椭圆章",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
],
"handwritings": [
{
"angel": 0,
"page": 0,
"text": "3月1日",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"angel": 0,
"page": 0,
"text": "张三",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"invoiceVerifyResult": {
"invoiceVerifyStatus": 0,
"invoiceVerifyErrorCode": 0,
"invoiceVerifyCanRetry": 0,
"invoiceVerifyFailMsg": "超过当天次数上限"
}
},
"document": {
"pages": [
{
"angle": 123,
"width": 123,
"height": 123,
"lines": [
{
"text": "<string>",
"position": [
123
],
"charPositions": [
[
123
]
]
}
]
}
]
},
"child_files": [
{
"id": 202412190001,
"task_id": 202412190001,
"task_type": 1,
"parent_task_id": 202412190001,
"batch_number": 202412190001,
"name": "invoice.pdf",
"format": "<string>",
"recognition_status": 0,
"verification_status": 0,
"category": "invoice",
"pages": [
{
"page": 1,
"angle": 0,
"width": 1024,
"height": 1024,
"dpi": 144
}
],
"data": {
"fields": [
{
"key": "发票代码",
"identifier": "发票代码标识",
"value": "3100231130",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "发票号码",
"value": "28737000",
"identifier": "发票号码标识",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"items": [
[
{
"key": "货物劳务名称",
"value": "*电子计算机*微型计算机主机",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "规格型号",
"value": "DMS-SC68",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
[
{
"key": "货物劳务名称",
"value": "*机械计算机*巨型计算机主机",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "规格型号",
"value": "AN/FSQ-7",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
]
],
"tables": [
{
"tableName": "table1",
"tableType": 0,
"items": [
[
{
"key": "<string>",
"identifier": "<string>",
"value": "<string>",
"textInLines": [
{
"angle": 0,
"pos": [
1
],
"page": 1,
"text": "文本内容",
"char_pos": [
[
1
]
]
}
],
"position": [
{
"page": 123,
"vertices": [
123
]
}
],
"index": 123
}
]
]
}
],
"stamps": [
{
"angel": 0,
"page": 0,
"text": "全国统一发票监制章",
"type": "其他",
"color": "红色",
"shape": "椭圆章",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
},
{
"angel": 0,
"page": 0,
"text": "税务局章",
"type": "其他",
"color": "红色",
"shape": "椭圆章",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
],
"handwritings": [
{
"angel": 0,
"page": 0,
"text": "3月1日",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"angel": 0,
"page": 0,
"text": "张三",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"invoiceVerifyResult": {
"invoiceVerifyStatus": 0,
"invoiceVerifyErrorCode": 0,
"invoiceVerifyCanRetry": 0,
"invoiceVerifyFailMsg": "超过当天次数上限"
}
},
"document": {
"pages": [
{
"angle": 123,
"width": 123,
"height": 123,
"lines": [
{
"text": "<string>",
"position": [
123
],
"charPositions": [
[
123
]
]
}
]
}
]
},
"from_parent_position_list": [
1
],
"crop_info": {
"page": 123,
"imageAngle": "<string>"
}
}
],
"duration_ms": 10000
}
]
}
}同步上传文件并等待处理完成,返回处理结果
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/file/upload/sync \
--header 'Content-Type: multipart/form-data' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--form file='@example-file'{
"code": 200,
"msg": "<string>",
"result": {
"total": 100,
"page": 1,
"page_size": 20,
"files": [
{
"id": 202412190001,
"name": "invoice.pdf",
"format": "<string>",
"recognition_status": 0,
"verification_status": 0,
"category": "invoice",
"task_id": 202412190001,
"task_type": 1,
"batch_number": 202412190001,
"failure_causes": "<string>",
"pages": [
{
"page": 1,
"angle": 0,
"width": 1024,
"height": 1024,
"dpi": 144
}
],
"data": {
"fields": [
{
"key": "发票代码",
"identifier": "发票代码标识",
"value": "3100231130",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "发票号码",
"value": "28737000",
"identifier": "发票号码标识",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"items": [
[
{
"key": "货物劳务名称",
"value": "*电子计算机*微型计算机主机",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "规格型号",
"value": "DMS-SC68",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
[
{
"key": "货物劳务名称",
"value": "*机械计算机*巨型计算机主机",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "规格型号",
"value": "AN/FSQ-7",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
]
],
"tables": [
{
"tableName": "table1",
"tableType": 0,
"items": [
[
{
"key": "<string>",
"identifier": "<string>",
"value": "<string>",
"textInLines": [
{
"angle": 0,
"pos": [
1
],
"page": 1,
"text": "文本内容",
"char_pos": [
[
1
]
]
}
],
"position": [
{
"page": 123,
"vertices": [
123
]
}
],
"index": 123
}
]
]
}
],
"stamps": [
{
"angel": 0,
"page": 0,
"text": "全国统一发票监制章",
"type": "其他",
"color": "红色",
"shape": "椭圆章",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
},
{
"angel": 0,
"page": 0,
"text": "税务局章",
"type": "其他",
"color": "红色",
"shape": "椭圆章",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
],
"handwritings": [
{
"angel": 0,
"page": 0,
"text": "3月1日",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"angel": 0,
"page": 0,
"text": "张三",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"invoiceVerifyResult": {
"invoiceVerifyStatus": 0,
"invoiceVerifyErrorCode": 0,
"invoiceVerifyCanRetry": 0,
"invoiceVerifyFailMsg": "超过当天次数上限"
}
},
"document": {
"pages": [
{
"angle": 123,
"width": 123,
"height": 123,
"lines": [
{
"text": "<string>",
"position": [
123
],
"charPositions": [
[
123
]
]
}
]
}
]
},
"child_files": [
{
"id": 202412190001,
"task_id": 202412190001,
"task_type": 1,
"parent_task_id": 202412190001,
"batch_number": 202412190001,
"name": "invoice.pdf",
"format": "<string>",
"recognition_status": 0,
"verification_status": 0,
"category": "invoice",
"pages": [
{
"page": 1,
"angle": 0,
"width": 1024,
"height": 1024,
"dpi": 144
}
],
"data": {
"fields": [
{
"key": "发票代码",
"identifier": "发票代码标识",
"value": "3100231130",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "发票号码",
"value": "28737000",
"identifier": "发票号码标识",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"items": [
[
{
"key": "货物劳务名称",
"value": "*电子计算机*微型计算机主机",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "规格型号",
"value": "DMS-SC68",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
[
{
"key": "货物劳务名称",
"value": "*机械计算机*巨型计算机主机",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "规格型号",
"value": "AN/FSQ-7",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
]
],
"tables": [
{
"tableName": "table1",
"tableType": 0,
"items": [
[
{
"key": "<string>",
"identifier": "<string>",
"value": "<string>",
"textInLines": [
{
"angle": 0,
"pos": [
1
],
"page": 1,
"text": "文本内容",
"char_pos": [
[
1
]
]
}
],
"position": [
{
"page": 123,
"vertices": [
123
]
}
],
"index": 123
}
]
]
}
],
"stamps": [
{
"angel": 0,
"page": 0,
"text": "全国统一发票监制章",
"type": "其他",
"color": "红色",
"shape": "椭圆章",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
},
{
"angel": 0,
"page": 0,
"text": "税务局章",
"type": "其他",
"color": "红色",
"shape": "椭圆章",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
],
"handwritings": [
{
"angel": 0,
"page": 0,
"text": "3月1日",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"angel": 0,
"page": 0,
"text": "张三",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"invoiceVerifyResult": {
"invoiceVerifyStatus": 0,
"invoiceVerifyErrorCode": 0,
"invoiceVerifyCanRetry": 0,
"invoiceVerifyFailMsg": "超过当天次数上限"
}
},
"document": {
"pages": [
{
"angle": 123,
"width": 123,
"height": 123,
"lines": [
{
"text": "<string>",
"position": [
123
],
"charPositions": [
[
123
]
]
}
]
}
]
},
"from_parent_position_list": [
1
],
"crop_info": {
"page": 123,
"imageAngle": "<string>"
}
}
],
"duration_ms": 10000
}
]
}
}空间ID
1234567890
文件类别
"invoice"
批次编号。
可以用同一个批次编号上传多次,后续可以用批次编号获取该批次多个文件处理结果。
如果值为空,则系统自动生成最长20位字符串
202412190001
是否自动进行发票验真
是否进行文件拆分
是否进行多图切分
目标处理类型。
可选值:
classify: 分类extract: 抽取classify, extract "classify"
文件上传请求体