メインコンテンツへスキップ
POST
/
api
/
app-api
/
sip
/
platform
/
v2
/
category
/
create
ファイルカテゴリを作成
curl --request POST \
  --url https://docflow.textin.com/api/app-api/sip/platform/v2/category/create \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-ti-app-id: <api-key>' \
  --header 'x-ti-secret-code: <api-key>' \
  --form workspace_id=1234567890 \
  --form 'name=インボイス' \
  --form 'extract_model=Model 1' \
  --form 'sample_files=<string>' \
  --form 'fields={
  "name": "インボイスコード",
  "description": "インボイスコードの説明",
  "prompt": "<string>",
  "use_prompt": true,
  "alias": [
    "インボイス No.",
    "請求書番号"
  ],
  "identity": "invoice_number",
  "multi_value": true,
  "duplicate_value_distinct": true,
  "transform_settings": {
    "datetime_settings": {
      "format": "yyyy-MM-dd"
    },
    "enumerate_settings": {
      "items": [
        "VAT 専用インボイス",
        "VAT 一般インボイス",
        "電子インボイス"
      ]
    },
    "regex_settings": {
      "match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
      "replace": "$1/$2/$3"
    },
    "mismatch_action": {
      "default_value": "N/A"
    }
  }
}' \
  --form 'category_prompt=VAT インボイス。インボイスコード、インボイス番号などのフィールドを含みます。' \
  --form 'description=<string>' \
  --form 'tables={
  "name": "明細テーブル",
  "prompt": "<string>",
  "collect_from_multi_table": true,
  "fields": [
    {
      "name": "インボイスコード",
      "description": "インボイスコードの説明",
      "prompt": "<string>",
      "use_prompt": true,
      "alias": [
        "インボイス No.",
        "請求書番号"
      ],
      "identity": "invoice_number",
      "multi_value": true,
      "duplicate_value_distinct": true,
      "transform_settings": {
        "datetime_settings": {
          "format": "yyyy-MM-dd"
        },
        "enumerate_settings": {
          "items": [
            "VAT 専用インボイス",
            "VAT 一般インボイス",
            "電子インボイス"
          ]
        },
        "regex_settings": {
          "match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
          "replace": "$1/$2/$3"
        },
        "mismatch_action": {
          "default_value": "N/A"
        }
      }
    }
  ]
}' \
  --form with_detail=true \
  --form sample_files.items='@example-file'
{
  "code": 200,
  "msg": "<string>",
  "result": {
    "category_id": "1234567890",
    "name": "<string>",
    "description": "<string>",
    "category_prompt": "<string>",
    "extract_model": "<string>",
    "enabled": 123,
    "fields": [
      {
        "name": "インボイスコード",
        "description": "インボイスコードの説明",
        "prompt": "<string>",
        "use_prompt": true,
        "alias": [
          "インボイス No.",
          "請求書番号"
        ],
        "identity": "invoice_number",
        "multi_value": true,
        "duplicate_value_distinct": true,
        "transform_settings": {
          "datetime_settings": {
            "format": "yyyy-MM-dd"
          },
          "enumerate_settings": {
            "items": [
              "VAT 専用インボイス",
              "VAT 一般インボイス",
              "電子インボイス"
            ]
          },
          "regex_settings": {
            "match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
            "replace": "$1/$2/$3"
          },
          "mismatch_action": {
            "default_value": "N/A"
          }
        },
        "id": "1234567890",
        "extract_model": "Model 1"
      }
    ],
    "tables": [
      {
        "id": "1234567890",
        "name": "Table 1",
        "description": "テーブルの説明",
        "prompt": "各行から品目名、数量、金額を抽出します",
        "collect_from_multi_table": true,
        "extract_model": "Model 1",
        "fields": [
          {
            "name": "インボイスコード",
            "description": "インボイスコードの説明",
            "prompt": "<string>",
            "use_prompt": true,
            "alias": [
              "インボイス No.",
              "請求書番号"
            ],
            "identity": "invoice_number",
            "multi_value": true,
            "duplicate_value_distinct": true,
            "transform_settings": {
              "datetime_settings": {
                "format": "yyyy-MM-dd"
              },
              "enumerate_settings": {
                "items": [
                  "VAT 専用インボイス",
                  "VAT 一般インボイス",
                  "電子インボイス"
                ]
              },
              "regex_settings": {
                "match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
                "replace": "$1/$2/$3"
              },
              "mismatch_action": {
                "default_value": "N/A"
              }
            },
            "id": "1234567890",
            "extract_model": "Model 1"
          }
        ]
      }
    ],
    "samples": [
      {
        "sample_id": "1234567890",
        "file_name": "invoice_sample.pdf"
      }
    ]
  }
}

承認

x-ti-app-id
string
header
必須
x-ti-secret-code
string
header
必須

ボディ

multipart/form-data
workspace_id
string
必須

ワークスペース ID

:

"1234567890"

name
string
必須

ファイルカテゴリ名

Maximum string length: 50
:

"インボイス"

extract_model
enum<string>
必須

抽出モデル

  • Model 1: 高速で安定した抽出結果
  • Model 2: 複雑な文書理解に適しています
  • Model 3: VLM。シンプルな抽出に適しています
利用可能なオプション:
Model 1,
Model 2,
Model 3
:

"Model 1"

sample_files
file[]
必須

サンプルファイルリスト。少なくとも 1 つのサンプルファイルをアップロードする必要があります。1 つのカテゴリには最大 20 個のサンプルファイルを設定できます

Required array length: 1 - 10 elements
fields
object[]
必須

フィールド設定リスト。少なくとも 1 つのフィールドを設定する必要があります

Minimum array length: 1
category_prompt
string

分類用プロンプト

Maximum string length: 150
:

"VAT インボイス。インボイスコード、インボイス番号などのフィールドを含みます。"

description
string

ファイルカテゴリの説明

tables
object[]

任意。テーブル設定リスト(一括作成)。ネストされたフィールドに対応しています

with_detail
boolean

完全な詳細を返すかどうか。true の場合、レスポンスにカテゴリの完全な情報(フィールド、テーブル、サンプルを含む)が含まれます。 未設定または false の場合、category_id のみを返します。

レスポンス

200 - application/json

ファイルカテゴリの作成に成功

code
integer
必須

ステータスコード

:

200

msg
string
必須

ステータス説明

result
object