> ## 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 Connector for Microsoft Power Automate の手動インストールと使用方法ガイド

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>;
};

Microsoft Power Automate 用の ABBYY Vantage コネクタを使用すると、開発者は自動化フローにデータ抽出機能とドキュメント分類機能を追加できます。これは、手動インストール用の再配布可能なパッケージです。

<div id="prerequisites">
  ## 事前準備
</div>

<Note>
  このコネクタを使用するには、Power Automate のプレミアム ライセンスが必要です。
</Note>

設定済みの [公開 API クライアント](/ja/vantage/documentation/tenant-admin/tenant-management/configure-client) がある Vantage テナントが必要です。このコネクタでは、次の設定を行います。

* **Authorized Redirect URL**: このセットアップ ガイドの後半で Power Automate から取得します。abbyy.com のリダイレクト URL はそのまま使用してください。
* **Client ID**: 公開 API クライアントの ID です。
* **Client Secret**: クライアントシークレットです。
* **Require PKCE for Authorization Code Flow** を無効にします。
* **Allow issuing refresh tokens to refresh access tokens** を有効にします。
* **Allow client credentials flow** を有効にします。Role(s) には `Skill User` を推奨します。

<Accordion title="設定済み API クライアントの例">
  <img src="https://mintcdn.com/abbyy/YpqdJk1A1n7Rrt8K/images/vantage/developer/connectors/ms-powerautomate/public-api-client.jpg?fit=max&auto=format&n=YpqdJk1A1n7Rrt8K&q=85&s=d425aa3ac98d861d817edb2811d6023c" alt="ABBYY Vantage 公開 API クライアント画面" width="1684" height="1688" data-path="images/vantage/developer/connectors/ms-powerautomate/public-api-client.jpg" />
</Accordion>

セキュリティ設定の手順では、Vantage テナント ID が必要です。

<Accordion title="テナント ID を確認する">
  <Steps>
    <Step title="テナント設定を開く">
      Vantage で、左ペインの **Configuration** をクリックします。
    </Step>

    <Step title="テナント ID をコピーする">
      **General** をクリックし、**Tenant ID** フィールドを探します。

      <img src="https://mintcdn.com/abbyy/YpqdJk1A1n7Rrt8K/images/vantage/developer/connectors/ms-powerautomate/finding-tenant-id.jpg?fit=max&auto=format&n=YpqdJk1A1n7Rrt8K&q=85&s=9797a2c9bf66dfa4ba7e4319c9717f4b" alt="ABBYY Vantage テナント設定画面" width="1414" height="610" data-path="images/vantage/developer/connectors/ms-powerautomate/finding-tenant-id.jpg" />
    </Step>
  </Steps>
</Accordion>

<div id="installing-the-connector">
  ## コネクタのインストール
</div>

まず、[ABBYY Marketplace からコネクタをダウンロード](https://www.abbyy.com/marketplace/assets/host/abbyy/connector/microsoft-power-automate/)します。

1. Microsoft Power Automate を開き、左側のメニューで **Data > Custom connectors** を選択します。見当たらない場合は、**More** を選択してください。

2. **+ New custom connector** をクリックし、**Import an OpenAPI file** を選択します。

3. コネクタ名 (例: "ABBYY Vantage") を入力します。

4. `ABBYY-Vantage-ProcessingAPI.swagger.json` ファイルを参照して開きます。

<div id="configure-general-information">
  ### 一般情報を設定する
</div>

1. \[任意] コネクタのダウンロードに含まれている ABBYY Vantage ロゴ (`Vantage-Square-icon.png`) を、コネクタアイコンとしてアップロードします。

2. **Host** URL を Vantage server のアドレスに変更します。同じホストアドレスを **Authorization URL** フィールドと **Token URL** フィールドでも使用する必要があります。

<VantageRegion>
  ```
  vantage-us.abbyy.com
  ```
</VantageRegion>

<div id="configure-security">
  ### セキュリティを設定する
</div>

**Authentication type** を **OAuth 2.0** に設定し、Vantage 公開 API クライアント の値を使用して次の field に入力します。

* **Client ID**: 公開 API クライアント の ID。
* **Client secret**: 公開 API クライアント の クライアントシークレット。
* **Authorization URL**: `https://vantage-[region].abbyy.com/auth2/[tenant-id]/connect/authorize`
* **Token URL**: `https://vantage-[region].abbyy.com/auth2/[tenant-id]/connect/token`
* **Refresh URL**: `https://vantage-[region].abbyy.com/auth2/[tenant-id]/connect/token`
* **Scope**: `openid permissions global.wildcard offline_access`

セキュリティ設定を完了するには、次の手順を実行します。

1. ページ上部の **Create Connector** をクリックして、コネクタを作成し、リダイレクト URL を生成します。

2. リダイレクト URL をコピーします。Vantage 公開 API クライアント の **Authorized Redirect URLs** で **Add Redirect URL** をクリックし、その URL を貼り付けます。

3. Vantage 公開 API クライアント の **OAuth 2.0 Flows Settings** で、次のように設定します。
   * **Require PKCE for Authorization Code Flow** を無効にします。
   * **Allow issuing refresh tokens to refresh access tokens** を有効にします。

<div id="create-a-connection">
  ## 接続を作成する
</div>

**Test** タブで **New Connection** を選択します。ログイン用のポップアップウィンドウが開きます。ABBYY Vantage の Username とパスワードを入力し、Microsoft Power Automate 用の公開 API クライアントが含まれているアカウントと同じアカウントを必ず選択してください。

<div id="test-the-connection">
  ## 接続をテストする
</div>

Vantage アカウントへのログインに成功すると、新しい接続が Connections リストに表示されます。オペレーションをテストして、コネクタが正しく機能していることを確認します。Operations リストから `ListAllAvailableSkills` を選択し、**Test operation** をクリックします。動作しない場合は、すべてのフィールドが正しく設定されていることを確認するため、前の手順を見直してください。

<div id="import-demo-flows">
  ## Import デモフロー
</div>

詳細は[サンプルプロセス](/ja/vantage/connectors/ms-powerautomate/sample-process)を参照してください。

<div id="modifying-flows">
  ## フローの変更
</div>

デモフローを変更することも、独自のフローを作成することもできます。JSON ベースのレスポンスから特定のデータセットを扱う必要がある場合は、JSON スキーマを変更できます。JSON スキーマを取得するには、Swagger UI を開いて必要なメソッドを呼び出します。Swagger UI は次の場所で利用できます。

<VantageRegion>
  ```
  https://vantage-[region].abbyy.com/api/index.html?urls.primaryName=publicapi%2Fv1
  ```
</VantageRegion>

<div id="next-steps">
  ## 次のステップ
</div>

Microsoft Power Automate コネクタの[リリースノート](/ja/vantage/connectors/ms-powerautomate/release-notes)を参照してください。
