> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# トランザクションの一覧を取得する

> ABBYY Vantage API を使用して、アクティブまたは完了したトランザクションの一覧を取得し、手動確認のステータスを確認し、手動確認用リンクを取得し、結果ファイルをダウンロードします。

export const VantageRegion = ({children}) => {
  const STORAGE_KEY = "abbyy.vantage.region";
  const REGIONS = [{
    code: "eu",
    label: "Europe"
  }, {
    code: "us",
    label: "North America"
  }, {
    code: "au",
    label: "Australia / Asia-Pacific"
  }];
  const [region, setRegion] = useState("eu");
  const [open, setOpen] = useState(false);
  const containerRef = useRef(null);
  const dropdownRef = useRef(null);
  function safeGetSavedRegion() {
    try {
      const saved = typeof window !== "undefined" ? window.localStorage.getItem(STORAGE_KEY) : null;
      const valid = new Set(REGIONS.map(r => r.code));
      return saved && valid.has(saved) ? saved : "eu";
    } catch {
      return "eu";
    }
  }
  function safeSetSavedRegion(code) {
    try {
      if (typeof window !== "undefined") {
        window.localStorage.setItem(STORAGE_KEY, code);
      }
    } catch {}
  }
  function dispatchRegionChanged(code) {
    try {
      if (typeof window !== "undefined") {
        window.dispatchEvent(new CustomEvent("abbyy:region-changed", {
          detail: {
            code
          }
        }));
      }
    } catch {}
  }
  function replaceRegionInString(text, currentRegion) {
    if (typeof text !== "string") return text;
    const hostRegex = /https:\/\/vantage-(eu|us|au)\.abbyy\.com/gi;
    const tokenRegex = /https:\/\/vantage-\[region\]\.abbyy\.com/gi;
    const bareHostRegex = /vantage-(eu|us|au)\.abbyy\.com/gi;
    const bareTokenRegex = /vantage-\[region\]\.abbyy\.com/gi;
    return text.replace(hostRegex, `https://vantage-${currentRegion}.abbyy.com`).replace(tokenRegex, `https://vantage-${currentRegion}.abbyy.com`).replace(bareHostRegex, `vantage-${currentRegion}.abbyy.com`).replace(bareTokenRegex, `vantage-${currentRegion}.abbyy.com`);
  }
  useEffect(() => {
    setRegion(safeGetSavedRegion());
  }, []);
  useEffect(() => {
    const root = containerRef.current;
    if (!root) return;
    const anchors = root.querySelectorAll("a[href]");
    anchors.forEach(a => {
      const href = a.getAttribute("href");
      if (href) {
        const next = replaceRegionInString(href, region);
        if (next !== href) {
          a.setAttribute("href", next);
        }
      }
    });
    const walker = typeof document !== "undefined" ? document.createTreeWalker(root, NodeFilter.SHOW_TEXT, null) : null;
    if (walker) {
      const toUpdate = [];
      let node = walker.nextNode();
      while (node) {
        const updated = replaceRegionInString(node.nodeValue, region);
        if (updated !== node.nodeValue) {
          toUpdate.push([node, updated]);
        }
        node = walker.nextNode();
      }
      toUpdate.forEach(([textNode, value]) => {
        textNode.nodeValue = value;
      });
    }
  }, [region, children]);
  useEffect(() => {
    const root = containerRef.current;
    if (!root) return;
    const anchors = root.querySelectorAll("a[href]");
    anchors.forEach(a => {
      a.style.fontWeight = "600";
      a.style.textDecoration = "underline";
      a.style.textUnderlineOffset = "2px";
    });
  }, [region, children]);
  useEffect(() => {
    const onRegionChanged = evt => {
      const code = evt && evt.detail && evt.detail.code;
      if (!code || code === region) return;
      setRegion(code);
    };
    if (typeof window !== "undefined") {
      window.addEventListener("abbyy:region-changed", onRegionChanged);
    }
    return () => {
      if (typeof window !== "undefined") {
        window.removeEventListener("abbyy:region-changed", onRegionChanged);
      }
    };
  }, [region]);
  useEffect(() => {
    const onClickAway = e => {
      if (!dropdownRef.current) return;
      if (!dropdownRef.current.contains(e.target)) {
        setOpen(false);
      }
    };
    document.addEventListener("click", onClickAway, true);
    return () => document.removeEventListener("click", onClickAway, true);
  }, []);
  const onSelect = code => {
    setRegion(code);
    safeSetSavedRegion(code);
    dispatchRegionChanged(code);
    setOpen(false);
  };
  const current = REGIONS.find(r => r.code === region) || REGIONS[0];
  return <div className="not-prose">
      <div className="mb-4 inline-flex items-center gap-2" ref={dropdownRef}>
        <span className="text-sm text-zinc-950/80 dark:text-white/80">Tenant Region:</span>
        <div className="relative">
          <button type="button" aria-haspopup="listbox" aria-expanded={open ? "true" : "false"} onClick={() => setOpen(v => !v)} className="h-8 px-3 rounded-md bg-zinc-900/5 dark:bg-white/5 border border-zinc-950/20 dark:border-white/20 text-sm inline-flex items-center gap-2">
            <span className="text-zinc-950 dark:text-white">{current.label}</span>
            <svg width="8" height="24" viewBox="0 -9 3 24" className="transition-transform text-gray-400 overflow-visible dark:text-gray-600 ml-auto" style={{
    transform: open ? "rotate(270deg)" : "rotate(90deg)"
  }}>
              <path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"></path>
            </svg>
          </button>
          {open ? <div role="listbox" className="absolute z-50 left-full top-0 ml-2 w-56 rounded-xl border border-zinc-950/20 dark:border-white/20 bg-white dark:bg-zinc-900 shadow-lg p-2">
              {REGIONS.map(r => {
    const selected = r.code === region;
    return <button key={r.code} type="button" role="option" aria-selected={selected ? "true" : "false"} onClick={() => onSelect(r.code)} className={"w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm hover:bg-zinc-950/5 dark:hover:bg-white/10 text-zinc-950 dark:text-white" + (selected ? " font-medium" : "")}>
                    <span style={selected ? {
      color: "#ff2038"
    } : undefined}>{r.label}</span>
                    <span className={selected ? "ml-3" : "ml-3 invisible"} style={selected ? {
      color: "#ff2038"
    } : undefined}>✓</span>
                  </button>;
  })}
            </div> : null}
        </div>
      </div>
      <div ref={containerRef} className="prose dark:prose-invert max-w-none">{children}</div>
    </div>;
};

アクティブまたは完了したすべてのトランザクションの一覧は、次の目的で使用できます。

* 現在手動確認ステージにあるアクティブなトランザクションを追跡する。
* アクティブなトランザクションの手動確認用リンクを取得する。
* 完了したトランザクションの結果ファイルをダウンロードする。

Vantage API を使用して、トランザクションの ID とともに一覧を取得できます。より高度なフィルターを適用するには、[Skill Monitor](/ja/vantage/documentation/runtime/skill-monitor/skill-monitor) を使用できます。

<div id="list-of-active-transactions">
  ### アクティブなトランザクションの一覧
</div>

アクティブなトランザクションの一覧を取得するには、`transactions/active` リソースに GET リクエストを送信します。

リクエスト本文では、次のパラメーターを指定します。

| Parameter             | Description                                                                                                                                                                                                                               |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| StageType             | トランザクションのステージ。<br />指定可能な値は次のとおりです。<br />- ManuaReview<br />- CustomActivity<br />- Automatic (ユーザー操作が不要なすべてのステージ。例: field の抽出)                                                                                                           |
| StageName             | 特定のアクションの名前 (ManualReview ステージでのみ使用) 。                                                                                                                                                                                                    |
| SkillId               | Skill の識別子。<br />値を指定しない場合は、利用可能なすべての Skill が対象になります。                                                                                                                                                                                     |
| SkillVersion          | Skill のバージョン。<br />値を指定しない場合は、利用可能な Skill のすべてのバージョンが対象になります。                                                                                                                                                                             |
| StartDate             | 最も早いトランザクションの作成時刻 (UTC 形式で指定する必要があります) 。                                                                                                                                                                                                  |
| EndDate               | 最も遅いトランザクションの作成時刻 (UTC 形式で指定する必要があります) 。<br />この値を指定しない場合は、現在の UTC 時刻が使用されます。                                                                                                                                                             |
| TransactionParameters | キーと値の string のペアからなるトランザクションパラメーターの一覧。これらのパラメーターにより、追加のユーザー情報 (例: クライアント名) を指定できます。<br />パラメーターは次の形式で指定する必要があります: `TransactionParameters={“key”: “string_1”,”value”:”string”}&TransactionParameters={“key”: “string_2”,”value”:”string”}` |
| DocumentParameters    | キーと値の string のペアからなるドキュメントパラメーターの一覧。これらのパラメーターにより、追加のドキュメント情報 (例: ファイル名) を指定できます。<br />パラメーターは次の形式で指定する必要があります: `DocumentParameters={“key”: “string_1”,”value”:”string”}&DocumentParameters={“key”: “string_2”,”value”:”string”}`         |
| Offset                | ページングのオフセット。<br />このパラメーターのデフォルト値は **0** です。                                                                                                                                                                                              |
| Limit                 | ページングの上限値。このパラメーターは必須です。<br />このパラメーターのデフォルト値は **0** です。                                                                                                                                                                                  |

サンプルリクエスト:

<VantageRegion>
  ```shell theme={null}
  curl -X GET "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/active"
  -H "Authorization: Bearer token"
  ```
</VantageRegion>

Skill識別子が指定されたリクエストに対するレスポンスには、次のようなJSONファイルが含まれます。

```json expandable theme={null}
{
  "items": [
    {
      "stage": "ManualReview",
      "stageName": "Review",
      "seqId": 13758,
      "transactionId": "56a50415-fe1d-4493-81ba-97ff07e3ffce",
      "createTimeUtc": "2023-09-11T13:53:30.633Z",
      "transactionParameters": [
        {
          "isReadOnly": true,
          "key": "string",
          "value": "string"
        },
        {
          "isReadOnly": true,
          "key": "App",
          "value": "PublicAPI"
        }
      ],
      "fileParameters": [
        {
          "isReadOnly": true,
          "key": "string",
          "value": "string"
        },
        {
          "isReadOnly": true,
          "key": "Index",
          "value": "0"
        },
        {
          "isReadOnly": true,
          "key": "SourceFileName",
          "value": "BillofLading_1.pdf"
        },
        {
          "isReadOnly": true,
          "key": "SourceType",
          "value": "PublicAPI"
        }
      ],
      "skillId": "workspace.default.processing",
      "skillVersion": 18,
      "documentCount": 1
    }
  ],
  "totalItemCount": 7
}
```

ステージとアクションが指定されたリクエストに対するレスポンスには、すべてのアクティブなトランザクションを含む、次のようなJSONファイルが返されます。

```json expandable theme={null}
{
  "items": [
    {
      "stage": "ManualReview",
      "stageName": "Review2",
      "seqId": 13852,
      "transactionId": "e646754e-d854-4b21-af91-58cb63ead7a6",
      "createTimeUtc": "2023-09-11T14:04:37.97Z",
      "transactionParameters": [
        {
          "isReadOnly": true,
          "key": "string",
          "value": "string"
        },
        {
          "isReadOnly": true,
          "key": "App",
          "value": "PublicAPI"
        }
      ],
      "fileParameters": [
        {
          "isReadOnly": true,
          "key": "string",
          "value": "string"
        },
        {
          "isReadOnly": true,
          "key": "Index",
          "value": "0"
        },
        {
          "isReadOnly": true,
          "key": "SourceFileName",
          "value": "BillofLading_1.pdf"
        },
        {
          "isReadOnly": true,
          "key": "SourceType",
          "value": "PublicAPI"
        }
      ],
      "documentCount": 1
    }
  ],
  "totalItemCount": 2
}
```

現在アクティブなトランザクションに対して、手動確認クライアントリンクを取得することも可能です。これを行うには、リクエスト URI にトランザクション識別子を含めて、`transactions/<transaction_id>` リソースに対して GET リクエストを送信します。

サンプルリクエスト：

<VantageRegion>
  ```shell theme={null}
  curl -X GET "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id" \
    -H "Authorization: Bearer token"
  ```
</VantageRegion>

レスポンスには、次のようなコードが含まれます。

<VantageRegion>
  ```json theme={null}
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "Processing",
    "manualReviewLink": "https://vantage-eu.abbyy.com/api/publicapi/v1/verify?documentIds=9838448d-72ae-4e9a-b071-2bb16f732e46",
    "sourceFiles": [
      {
        "id": "7b2eed6f-3fdd-43b9-a178-7211d0a8d5bb",
        "name": "Invoice07.JPG"
      }
    ]
  }
  ```
</VantageRegion>

`manualReviewLink` キーには、手動確認クライアントの Web インターフェイスへのリンクと、手動確認が必要な場合の Vantage アクセストークンが含まれます。このリンクとトークンを使用して、特定のトランザクションの分類および field の抽出結果を確認および修正できます。提供されたリンクは 168 時間有効で、有効期限後は同じ方法で新しいリンクを作成して取得し、さらに 168 時間利用する必要があります。詳しくは、[手動確認の統合](/ja/vantage/developer/integrating-manual-review)を参照してください。

<Info>
  このリンク経由で認証されたユーザーは、他の文書やトランザクションを閲覧または変更することはできません。
</Info>

<div id="list-of-completed-transactions">
  ### 完了したトランザクションの一覧
</div>

完了したトランザクションの一覧を取得するには、`transactions/completed` リソースに対して GET リクエストを送信します。

リクエストボディでは、次のパラメーターを指定します。

| Parameter             | Description                                                                                                                                                                                                                     |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TransactionStatus     | トランザクションのステータス。<br />指定可能な値は次のとおりです。<br />- Processed<br />- Canceled<br />- Failed                                                                                                                                             |
| SkillId               | Skill の識別子。<br />値が指定されていない場合、利用可能なすべての Skill が対象となります。                                                                                                                                                                         |
| SkillVersion          | Skill のバージョン。<br />値が指定されていない場合、利用可能なすべての Skill のバージョンが対象となります。                                                                                                                                                                 |
| StartDate             | 最も早いトランザクションの作成時刻 (UTC 形式で指定する必要があります) 。                                                                                                                                                                                        |
| EndDate               | 最も遅いトランザクションの作成時刻 (UTC 形式で指定する必要があります) 。<br />この値が指定されていない場合は、現在の UTC 時刻が使用されます。                                                                                                                                                |
| TransactionParameters | キーと値の文字列ペアで構成されるトランザクションパラメーターの一覧。このパラメーターにより、追加のユーザー情報 (例: 顧客名) を指定できます。<br />パラメーターは次の形式で指定する必要があります: `TransactionParameters={“key”: “string_1”,”value”:”string”}&TransactionParameters={“key”: “string_2”,”value”:”string”}` |
| DocumentParameters    | キーと値の文字列ペアで構成されるドキュメントパラメーターの一覧。このパラメーターにより、追加のドキュメント情報 (例: ファイル名) を指定できます。<br />パラメーターは次の形式で指定する必要があります: `DocumentParameters={“key”: “string_1”,”value”:”string”}&DocumentParameters={“key”: “string_2”,”value”:”string”}`     |
| Offset                | ページネーションのオフセット。<br />このパラメーターの既定値は **0** です。                                                                                                                                                                                    |
| Limit                 | ページネーションの上限値。必須のパラメーターです。<br />このパラメーターの既定値は **0** です。                                                                                                                                                                          |

レスポンスには、すべての完了したトランザクションと、次の例のような処理されたページ数を含む JSON ファイルが返されます。

```json expandable theme={null}
{
  "items": [
    {
      "status": "FinishedSuccessfully",
      "pageCount": 1,
      "seqId": 13705,
      "transactionId": "fc9920fe-f788-47f8-9972-b767493faed9",
      "createTimeUtc": "2023-09-11T13:47:50.273Z",
      "transactionParameters": [
        {
          "isReadOnly": true,
          "key": "string",
          "value": "string"
        },
        {
          "isReadOnly": true,
          "key": "App",
          "value": "PublicAPI"
        }
      ],
      "fileParameters": [
        {
          "isReadOnly": true,
          "key": "string",
          "value": "string"
        },
        {
          "isReadOnly": true,
          "key": "Index",
          "value": "0"
        },
        {
          "isReadOnly": true,
          "key": "SourceFileName",
          "value": "BillofLading_1.pdf"
        },
        {
          "isReadOnly": true,
          "key": "SourceType",
          "value": "PublicAPI"
        }
      ],
      "documentCount": 1
    },
    {
      "status": "FinishedSuccessfully",
      "pageCount": 2,
      "seqId": 29842,
      "transactionId": "c0dd3e08-f295-4c6c-b919-31eaa67817cc",
      "createTimeUtc": "2023-09-12T19:28:01.27Z",
      "transactionParameters": [
        {
          "isReadOnly": true,
          "key": "App",
          "value": "VantageUI"
        }
      ],
      "fileParameters": [
        {
          "isReadOnly": true,
          "key": "SourceFileName",
          "value": "Invoice _ 1213123123 _2__signed_signed _1__signed _1_.pdf"
        },
        {
          "isReadOnly": true,
          "key": "SourceType",
          "value": "VantageUI"
        }
      ],
      "documentCount": 1
    },
    {
      "status": "FinishedSuccessfully",
      "pageCount": 2,
      "seqId": 36254,
      "transactionId": "8391871e-abf5-41bc-8a66-1059418a3843",
      "createTimeUtc": "2023-09-13T08:53:41.9Z",
      "transactionParameters": [
        {
          "isReadOnly": true,
          "key": "App",
          "value": "VantageUI"
        }
      ],
      "fileParameters": [
        {
          "isReadOnly": true,
          "key": "SourceFileName",
          "value": "Invoice _ 1213123123 _2__signed_signed _1__signed _1_.pdf"
        },
        {
          "isReadOnly": true,
          "key": "SourceType",
          "value": "VantageUI"
        }
      ],
      "documentCount": 1
    },
    {
      "status": "FinishedSuccessfully",
      "pageCount": 2,
      "seqId": 36632,
      "transactionId": "7f7cd557-a03e-42e3-a454-e7981e8e9fc0",
      "createTimeUtc": "2023-09-13T09:35:27.48Z",
      "transactionParameters": [
        {
          "isReadOnly": true,
          "key": "App",
          "value": "VantageUI"
        }
      ],
      "fileParameters": [
        {
          "isReadOnly": true,
          "key": "SourceFileName",
          "value": "Invoice _ 1213123123 _2__signed_signed _1__signed.pdf"
        },
        {
          "isReadOnly": true,
          "key": "SourceType",
          "value": "VantageUI"
        }
      ],
      "documentCount": 1
    },
    {
      "status": "FinishedSuccessfully",
      "pageCount": 2,
      "seqId": 36663,
      "transactionId": "c9b3cd4d-d90f-48be-adc2-99985ece4e11",
      "createTimeUtc": "2023-09-13T09:38:29.573Z",
      "transactionParameters": [
        {
          "isReadOnly": true,
          "key": "App",
          "value": "VantageUI"
        }
      ],
      "fileParameters": [
        {
          "isReadOnly": true,
          "key": "SourceFileName",
          "value": "Invoice _ 1213123123 _2__signed_signed _1__signed.pdf"
        },
        {
          "isReadOnly": true,
          "key": "SourceType",
          "value": "VantageUI"
        }
      ],
      "documentCount": 1
    }
  ],
  "totalItemCount": 5
}
```
