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

ファイルの操作

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

ドキュメントの抽出

POST https://api-{location-id}.flexicapture.com/v2/task/capture/documents
リクエストパラメーターの変更点:
  • request body に 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 array は削除され、files キーは services array から documents array に移動しました
  • number は integer ではなく string 型になりました
  • progress は integer ではなく浮動小数点数になりました

請求書抽出タスク

POST https://api-{location-id}.flexicapture.com/v2/task/capture/invoices
リクエストパラメーターの変更点:
  • リクエスト本文には、business_unitemaillabel の各キーを含めなくなりました
  • 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 は integer ではなく string 型になりました
  • progress は integer ではなく浮動小数点数になりました
  • regionexport_formatverification_type の各キーは properties 辞書に移動しました
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 は integer ではなく string 型になりました
  • progress は integer ではなく浮動小数点数になりました
  • regionexport_formatverification_type の各キーは properties 辞書に移動しました
DELETE https://api-{location-id}.flexicapture.com/v2/task/{id}

データセットの操作

POST https://api-{location-id}.flexicapture.com/v2/dataset/businessunits
リクエストとレスポンスの両方で、次のキーには候補を含む配列が含まれるようになりました: name, street, city, state, zip, vat
PUT https://api-{location-id}.flexicapture.com/v2/dataset/businessunits
リクエストとレスポンスの両方で、次のキーには候補を含む配列が含まれるようになりました: name, street, city, state, zip, vat
GET https://api-{location-id}.flexicapture.com/v2/dataset/businessunits/{region}
オプションのクエリパラメーターを使用して、いずれかの事業部門のデータを取得できるようになりました: externalId, skip, takeリクエストとレスポンスの両方で、次のキーには候補を含む配列が含まれるようになりました: name, street, city, state, zip, vat
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/businessunits/{region}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/businessunit/{region}/{externalId}
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 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 https://api-{location-id}.flexicapture.com/v2/dataset/vendors/{region}
オプションのクエリパラメーターを使用して、いずれかの事業部門のデータを取得できるようになりました: externalId, skip, takeリクエストとレスポンスの両方で、次のキーには候補を含む配列が含まれるようになりました: name, street, city, state, zip, vat, national_vat, iban, bank_account, bank_code, gl_code
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/vendors/{region}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/vendors/{region}/{externalId}

データ抽出モデルの学習

POST https://api-{location-id}.flexicapture.com/v2/training
PUT https://api-{location-id}.flexicapture.com/v2/training
GET https://api-{location-id}.flexicapture.com/v2/training/layout/{taskId}/{fileId}
POST https://api-{location-id}.flexicapture.com/v2/training/station/{taskId}
PUT https://api-{location-id}.flexicapture.com/v2/training/station/{taskId}
GET https://api-{location-id}.flexicapture.com/v2/training/batch{region}