同步上传文件
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>",
"category": "invoice",
"task_id": 202412190001,
"task_detail_url": "<string>",
"task_type": 1,
"batch_number": 202412190001,
"failure_causes": "<string>",
"pages": [
{
"page": 1,
"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": "发票号码",
"identifier": "发票号码标识",
"value": "28737000",
"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,
"usePrompt": true,
"extractModel": "<string>",
"configModel": "<string>",
"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,
"confidence": 0.95
}
]
]
}
],
"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_detail_url": "<string>",
"task_type": 1,
"parent_task_id": 202412190001,
"batch_number": 202412190001,
"name": "invoice.pdf",
"format": "<string>",
"category": "invoice",
"pages": [
{
"page": 1,
"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": "发票号码",
"identifier": "发票号码标识",
"value": "28737000",
"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,
"extractModel": "<string>",
"configModel": "<string>",
"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,
"confidence": 0.95
}
]
]
}
],
"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,
"total_page_num": 10,
"parser_params": {
"formula_level": 0,
"apply_merge": 1,
"table_text_split_mode": 0,
"crop_dewarp": 0,
"remove_watermark": 0,
"dpi": 144,
"parse_mode": "auto",
"pdf_pwd": "<string>"
}
}
]
}
}API Reference
同步上传文件
同步上传文件并等待处理完成,返回处理结果
POST
/
api
/
app-api
/
sip
/
platform
/
v2
/
file
/
upload
/
sync
同步上传文件
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>",
"category": "invoice",
"task_id": 202412190001,
"task_detail_url": "<string>",
"task_type": 1,
"batch_number": 202412190001,
"failure_causes": "<string>",
"pages": [
{
"page": 1,
"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": "发票号码",
"identifier": "发票号码标识",
"value": "28737000",
"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,
"usePrompt": true,
"extractModel": "<string>",
"configModel": "<string>",
"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,
"confidence": 0.95
}
]
]
}
],
"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_detail_url": "<string>",
"task_type": 1,
"parent_task_id": 202412190001,
"batch_number": 202412190001,
"name": "invoice.pdf",
"format": "<string>",
"category": "invoice",
"pages": [
{
"page": 1,
"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": "发票号码",
"identifier": "发票号码标识",
"value": "28737000",
"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,
"extractModel": "<string>",
"configModel": "<string>",
"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,
"confidence": 0.95
}
]
]
}
],
"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,
"total_page_num": 10,
"parser_params": {
"formula_level": 0,
"apply_merge": 1,
"table_text_split_mode": 0,
"crop_dewarp": 0,
"remove_watermark": 0,
"dpi": 144,
"parse_mode": "auto",
"pdf_pwd": "<string>"
}
}
]
}
}查询参数
空间ID
示例:
1234567890
文件类别
示例:
"invoice"
批次编号。
可以用同一个批次编号上传多次,后续可以用批次编号获取该批次多个文件处理结果。
如果值为空,则系统自动生成最长20位字符串
示例:
202412190001
是否自动进行发票验真
是否进行文件拆分
是否进行多图切分
目标处理类型。
可选值:
classify: 分类extract: 抽取
可用选项:
classify, extract 示例:
"classify"
是否去水印(0:不去水印、1:去水印)
是否进行切边矫正(0:不进行切边矫正、1:进行切边矫正)
是否进行跨页段落表格合并(0:不合并、1:合并)
公式识别等级(0 行间公式和行内公式都识别、1 仅识别行间公式,行内公式不识别、2 不识别公式)
表格线是否分割ocr文本(0:不切割、1:切割)
文件分辨率(144:默认、216:高精度)
可用选项:
144, 216 解析模式
auto: 自动(默认)scan: 扫描件模式vlm: VLM模式
可用选项:
auto, scan, vlm PDF文件密码,用于解密加密的PDF文件
是否返回任务详情页URL
请求体
multipart/form-dataapplication/json
文件上传请求体
⌘I

