メインコンテンツへスキップ
ABBYY FlexiCapture for Invoices Cloud REST API をバージョン 1 からバージョン 2 にアップグレードする場合は、コードにいくつか変更を加える必要があります。 主な変更点は次のとおりです。
  • アプリケーション — 新しいバージョンでは、アプリケーションの概念が導入されています。1 つのアカウントに複数のアプリケーションを作成でき、それぞれが独立して動作します。各アプリケーションが扱えるのは、自身のタスク、処理データ、モデルだけであり、他のアプリケーションのこれらの情報にはアクセスできません。
  • 複数列 field — field は候補を持てるようになり、表記ゆれや誤りがあっても、ベンダーや事業部門との照合がしやすくなりました。抽出された field は、候補を含む配列として表現されます。
  • URL 内のバージョン更新 — URL はバージョンに応じて変更されました。URL 内の v1v2 に変更されています。
バージョン 1 の API メソッドを以下にカテゴリ別に示します。各エントリには、バージョン 2 の URL と、リクエストおよびレスポンスの変更点が記載されています。

ファイルの操作

POST /file

POST https://api-{location-id}.flexicapture.com/v1/file
POST https://api-{location-id}.flexicapture.com/v2/file
  • email クエリパラメーターを削除しました。代わりに、アカウントのメールアドレスを使用します。
  • レスポンスに application (application ID) と expiring (ファイルの有効期限日) を追加しました。
  • レスポンスから削除しました: ファイルの検証と削除に関するキー (validatedis_validateddeletedis_deleted) 、エラーメッセージ (error) 、およびページ数 (pages_count) 。

GET /file///info

GET https://api-{location-id}.flexicapture.com/v1/file/{id}/{token}/info
GET https://api-{location-id}.flexicapture.com/v2/file/{id}/{token}/info
  • 削除されたファイルではメタデータを取得できなくなり、現在は 404 レスポンス が返されます。
  • レスポンス に追加: application (application ID) および expiring (ファイルの有効期限) 。
  • レスポンス から削除: ファイルの検証と削除に関するキー (validatedis_validateddeletedis_deleted) 、エラーメッセージ (error) 、およびページ数 (pages_count) 。

GET /file//

GET https://api-{location-id}.flexicapture.com/v1/file/{id}/{token}
GET https://api-{location-id}.flexicapture.com/v2/file/{id}/{token}

DELETE /file//

DELETE https://api-{location-id}.flexicapture.com/v1/file/{id}/{token}
DELETE https://api-{location-id}.flexicapture.com/v2/file/{id}/{token}

ドキュメントの抽出

POST /task/capture/documents

POST https://api-{location-id}.flexicapture.com/v1/capture/data
POST https://api-{location-id}.flexicapture.com/v2/task/capture/documents
リクエストの変更:
  • リクエスト本文には、email キーと label キーが含まれなくなりました。
  • regionexport_formatverification_type キーは properties 辞書に移動されました。
レスポンスの変更:
  • 追加されたキー: batch_id, is_realtime_enabled, processing_priority, is_demo, account, application, is_extra_error, documents > data, documents > is_moved, documents > traininglayout_fileid.
  • 削除されたキー: label, lead_time, started, delivered, deleted, wait_for_action, is_test, region, export_format, verification_type, business_unit, properties > export_format, properties > verification_type.
  • services 配列は削除され、files キーは services 配列から documents 配列に移動されました。
  • number は、整数ではなく string になりました。
  • progress は、整数ではなく浮動小数点数になりました。

請求書抽出タスク

POST /task/capture/invoices

POST https://api-{location-id}.flexicapture.com/v1/capture/invoices
POST https://api-{location-id}.flexicapture.com/v2/task/capture/invoices
リクエストの変更点:
  • リクエスト本文には、business_unitemaillabel の各キーを含めなくなりました。
  • regionexport_formatverification_type の各キーは、properties 辞書に移動されました。
レスポンスの変更点:
  • 追加されたキー: batch_idis_realtime_enabledprocessing_priorityis_demoaccountapplicationis_extra_errordocuments > datadocuments > is_moveddocuments > traininglayout_fileid
  • 削除されたキー: labellead_timestarteddelivereddeletedwait_for_actionis_testregionexport_formatverification_typebusiness_unitproperties > export_formatproperties > verification_type
  • services 配列は削除され、files キーは services 配列から documents 配列に移動されました。
  • number は、integer ではなく string になりました。
  • progress は、integer ではなく浮動小数点数になりました。

GET /task/

GET https://api-{location-id}.flexicapture.com/v1/task/{id}
GET https://api-{location-id}.flexicapture.com/v2/task/{id}
レスポンスは現在、タスク作成メソッドと同じ形式で構成されています。
  • タスク作成メソッドと同様に、次のキーが追加されました: batch_id, is_realtime_enabled, processing_priority, is_demo, account, application, documents_count, pages_count, is_extra_error, documents > data, documents > is_moved, documents > traininglayout_fileid.
  • 抽出データに関連するキー — documents > data > { region, export_format, verification_type, vendor_name, invoice_date, total, currency } — と、タスクの請求に関連するキー billed, is_billed が追加されました。
  • 次のキーが削除されました: label, lead_time, deleted, wait_for_action, is_test, region, export_format, verification_type, business_unit.
  • services 配列は削除され、files キーは services 配列から documents 配列に移動しました。
  • number は整数ではなく文字列になりました。
  • progress は整数ではなく浮動小数点数になりました。

DELETE /task/

DELETE https://api-{location-id}.flexicapture.com/v1/task/{id}
DELETE https://api-{location-id}.flexicapture.com/v2/task/{id}

データセットの操作

POST /dataset/businessunits

POST https://api-{location-id}.flexicapture.com/v1/dataset/businessunits
POST https://api-{location-id}.flexicapture.com/v2/dataset/businessunits
  • リクエストとレスポンスの両方で、次のキーには候補を含む配列が含まれるようになりました: name, street, city, state, zip, vat.

PUT /dataset/businessunits

PUT https://api-{location-id}.flexicapture.com/v1/dataset/businessunits
PUT https://api-{location-id}.flexicapture.com/v2/dataset/businessunits
  • リクエストとレスポンスの両方で、次のキーには候補を含む配列が含まれるようになりました: name, street, city, state, zip, vat.

GET /dataset/businessunits/

GET https://api-{location-id}.flexicapture.com/v1/dataset/businessunits/{region}
GET https://api-{location-id}.flexicapture.com/v2/dataset/businessunits/{region}
  • オプションのクエリ パラメーター externalIdskiptake を使用して、いずれかの事業部門のデータを取得できるようになりました。
  • リクエストとレスポンスの両方で、次のキーには候補を含む配列が入るようになりました: name, street, city, state, zip, vat

DELETE /dataset/businessunits/

DELETE https://api-{location-id}.flexicapture.com/v1/dataset/businessunits/{region}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/businessunits/{region}

DELETE /dataset/businessunit//

DELETE https://api-{location-id}.flexicapture.com/v1/dataset/businessunit/{region}/{externalId}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/businessunit/{region}/{externalId}

POST /dataset/vendors

POST https://api-{location-id}.flexicapture.com/v1/dataset/vendors
POST https://api-{location-id}.flexicapture.com/v2/dataset/vendors
  • リクエストとレスポンスの両方で、次のキーには候補の配列が含まれるようになりました: name, street, city, state, zip, vat, national_vat, iban, bank_account, bank_code, gl_code.

PUT /dataset/vendors

PUT https://api-{location-id}.flexicapture.com/v1/dataset/vendors
PUT https://api-{location-id}.flexicapture.com/v2/dataset/vendors
  • リクエストとレスポンスの両方で、次のキーの値が候補を含む配列になりました: name, street, city, state, zip, vat, national_vat, iban, bank_account, bank_code, gl_code.

GET /dataset/vendors/

GET https://api-{location-id}.flexicapture.com/v1/dataset/vendors/{region}
GET https://api-{location-id}.flexicapture.com/v2/dataset/vendors/{region}
  • オプションのクエリパラメーター externalIdskiptake を使用して、いずれか 1 つのベンダーのデータを取得できるようになりました。
  • リクエストとレスポンスの両方で、次のキーには候補を含む配列が入るようになりました: name, street, city, state, zip, vat, national_vat, iban, bank_account, bank_code, gl_code

DELETE /dataset/vendors/

DELETE https://api-{location-id}.flexicapture.com/v1/dataset/vendors/{region}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/vendors/{region}

DELETE /dataset/vendors//

DELETE https://api-{location-id}.flexicapture.com/v1/dataset/vendors/{region}/{externalId}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/vendors/{region}/{externalId}

データ抽出モデルの学習

POST /training

POST https://api-{location-id}.flexicapture.com/v1/data/train
POST https://api-{location-id}.flexicapture.com/v2/training

PUT /training

PUT https://api-{location-id}.flexicapture.com/v1/data/train
PUT https://api-{location-id}.flexicapture.com/v2/training

GET /training/layout//

GET https://api-{location-id}.flexicapture.com/v1/data/{taskId}/{fileId}
GET https://api-{location-id}.flexicapture.com/v2/training/layout/{taskId}/{fileId}

POST /training/station/

POST https://api-{location-id}.flexicapture.com/v1/data/train/station/{taskId}
POST https://api-{location-id}.flexicapture.com/v2/training/station/{taskId}

PUT /training/station/

PUT https://api-{location-id}.flexicapture.com/v1/data/train/station/{taskId}
PUT https://api-{location-id}.flexicapture.com/v2/training/station/{taskId}

GET /training/batch

GET https://api-{location-id}.flexicapture.com/v1/data/batch/{region}
GET https://api-{location-id}.flexicapture.com/v2/training/batch{region}