特定フィールドを抽出
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/file/extract_fields \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"workspace_id": 1234567890,
"task_id": 1234567890,
"fields": [
{
"key": "インボイスコード",
"prompt": "年の部分のみを保持します",
"extract_model": "Model 1"
}
],
"tables": [
{
"name": "Table1",
"extract_model": "Model 1",
"fields": [
{
"key": "インボイスコード",
"prompt": "年の部分のみを保持します",
"extract_model": "Model 1"
}
]
}
]
}
'{
"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": "*Electronic Computer*Microcomputer Host",
"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": "*Mechanical Computer*Supercomputer Host",
"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>",
"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": "Other",
"color": "Red",
"shape": "Oval Seal",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
},
{
"angel": 0,
"page": 0,
"text": "税務局印",
"type": "Other",
"color": "Red",
"shape": "Oval Seal",
"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": "1日の上限を超過しました"
}
},
"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": "*Electronic Computer*Microcomputer Host",
"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": "*Mechanical Computer*Supercomputer Host",
"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>",
"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": "Other",
"color": "Red",
"shape": "Oval Seal",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
},
{
"angel": 0,
"page": 0,
"text": "税務局印",
"type": "Other",
"color": "Red",
"shape": "Oval Seal",
"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": "1日の上限を超過しました"
}
},
"document": {
"pages": [
{
"angle": 123,
"width": 123,
"height": 123,
"lines": [
{
"text": "<string>",
"position": [
123
],
"charPositions": [
[
123
]
]
}
]
}
]
},
"from_parent_position_list": [
1
],
"crop_info": {
"page": 123,
"image角度": "<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
特定フィールドを抽出
抽出が完了したタスクに対して、追加フィールドを抽出するか、既存フィールドを個別に再抽出します。
すべてのフィールドの完全な抽出結果を返します。戻り構造は /api/app-api/sip/platform/v2/file/fetch と同じです。
POST
/
api
/
app-api
/
sip
/
platform
/
v2
/
file
/
extract_fields
特定フィールドを抽出
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/file/extract_fields \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"workspace_id": 1234567890,
"task_id": 1234567890,
"fields": [
{
"key": "インボイスコード",
"prompt": "年の部分のみを保持します",
"extract_model": "Model 1"
}
],
"tables": [
{
"name": "Table1",
"extract_model": "Model 1",
"fields": [
{
"key": "インボイスコード",
"prompt": "年の部分のみを保持します",
"extract_model": "Model 1"
}
]
}
]
}
'{
"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": "*Electronic Computer*Microcomputer Host",
"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": "*Mechanical Computer*Supercomputer Host",
"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>",
"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": "Other",
"color": "Red",
"shape": "Oval Seal",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
},
{
"angel": 0,
"page": 0,
"text": "税務局印",
"type": "Other",
"color": "Red",
"shape": "Oval Seal",
"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": "1日の上限を超過しました"
}
},
"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": "*Electronic Computer*Microcomputer Host",
"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": "*Mechanical Computer*Supercomputer Host",
"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>",
"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": "Other",
"color": "Red",
"shape": "Oval Seal",
"position": [
0,
0,
100,
0,
100,
100,
0,
100
]
},
{
"angel": 0,
"page": 0,
"text": "税務局印",
"type": "Other",
"color": "Red",
"shape": "Oval Seal",
"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": "1日の上限を超過しました"
}
},
"document": {
"pages": [
{
"angle": 123,
"width": 123,
"height": 123,
"lines": [
{
"text": "<string>",
"position": [
123
],
"charPositions": [
[
123
]
]
}
]
}
]
},
"from_parent_position_list": [
1
],
"crop_info": {
"page": 123,
"image角度": "<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>"
}
}
]
}
}ボディ
application/json
⌘I

