Orchestrator
最新
バナーの背景画像
Orchestrator API ガイド
最終更新日 2024年4月24日

クラウド API の利用

概要

UiPath Automation CloudTM has two mechanisms for consuming APIs:

  • getting the API access information from Automation CloudTM (described on this page)
  • registering an external application to use the OAuth flow ( information and instructions ).

Which mechanism to use? You can use whichever mechanism you want, but if your Automation CloudTM organization uses the Azure Active Directory model , you must register external applications in Automation CloudTM and use the OAuth flow.

注:

All clients that used to connect to Orchestrator CE via API, or using PowerShell and other scripting tools, need to be updated in order to connect to the UiPath Automation CloudTM.

On-Premises Orchestrator、またはプライベート クラウドにインストールされている Orchestrator は変更されていません。これらの Orchestrator インスタンスに接続する場合は、API 連携、PowerShell などのスクリプト ツールをこれまでどおり使用できます。

Getting the API Access Information From the Automation CloudTM UI

The Services page within your Automation CloudTM account enables you to access API specific information for each of your existing services, allowing you to easily find the information required for authenticating to your cloud-based Orchestrator services via API calls.

注:

ローカル ユーザーは、組織レベルのロールに関係なく、Orchestrator サービスの API アクセス情報を表示できます。

ディレクトリ ユーザーは、以下で説明するように Orchestrator サービスの API アクセス情報を表示できません。代わりに、外部アプリケーションを登録して OAuth フローを使用する必要があります。

  1. Log in to your Automation CloudTM account.
  2. [管理] > [テナント] に移動します。[テナント] ページに、既存のすべてのテナントのリストが表示されます。
  3. 任意のテナントの左側にある矢印をクリックし、利用可能なサービスを表示します。
  4. Orchestrator サービスの [API アクセス] をクリックします。 [API アクセス] ウィンドウが開き、サービスに固有な以下の情報が表示されます。
  • ユーザー キー - 代わりにログインしてアクションを実行するために API またはサード パーティのアプリケーションで使用する一意のログイン キーを生成できます。これは、以前は更新トークンと呼ばれていました。
  • 組織 ID - 組織名です。これはベース URL の後に続く名前です。
  • テナント名 - テナントの表示名です。
  • クライアント ID - Orchestrator アプリケーション自体に固有であり、特定のプラットフォーム上のすべてのユーザーおよびテナントで同一です。たとえば、https://cloud.uipath.com 上のすべてのテナントは、同じ値のクライアント ID を持ちます。



このウィンドウを閉じないでください。認証呼び出しを実行するには、この情報が必要です。各フィールドの横にあるコピー ボタン をクリックして、値をコピーします。

Authenticating to Your Automation CloudTM Based Orchestrator Tenant

認証操作では、POST 要求を https://account.uipath.com/oauth/token に送信します。要求と応答は次の例のようになります。

POST

https://account.uipath.com/oauth/token

要求ヘッダー

キー

値 (Value)

認可

Bearer

要求本文

{
    "grant_type": "refresh_token",
    "client_id": "{client_ID}",
    "refresh_token": "{user_key}"
}{
    "grant_type": "refresh_token",
    "client_id": "{client_ID}",
    "refresh_token": "{user_key}"
}

応答コード

200 OK

応答本文

{
  "access_token": "{access_token}",
  "id_token": "{id_token}",
  "scope": "openid profile email offline_access",
  "expires_in": 86400,
  "token_type": "Bearer"
}{
  "access_token": "{access_token}",
  "id_token": "{id_token}",
  "scope": "openid profile email offline_access",
  "expires_in": 86400,
  "token_type": "Bearer"
}
注: 前のセクションで説明したように、[API アクセス] ページから、{tenant_name}{client_ID}、および {user_key} の値を取得します。
後で使用するために {access_token} をコピーします。
重要: Orchestrator API の呼び出しを実行するのに必要な {access_token} の有効期限は 24 時間です。{refresh_token} を使用して {access_token} を再生成する必要があります。そうしないと、ステータス コード 401 が返されます。

Orchestrator API 呼び出しを送信する

  1. https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Settings/UiPath.Server.Configuration.OData.GetLicense に GET 要求を送信します。
  2. {organization_name}{tenant_name} を [API アクセス] ページの値に置き換えます。
  3. 認可ヘッダーを Bearer {access_token} に設定し、上記の手順で受け取った {access_token} の値に貼り付けます。

要求を送信すると、このサービスのライセンス情報を含む応答が Orchestrator から返されます。

要求と応答は次の例のようになります。

GET

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Settings/UiPath.Server.Configuration.OData.GetLicense

要求ヘッダー

キー

値 (Value)

認可

Bearer

応答コード

200 OK

応答本文

{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#UiPath.Application.Dto.License.LicenseDto",
    "HostLicenseId": null,
    "Id": 0,
    "ExpireDate": 1622678399,
    "GracePeriodEndDate": 1622678399,
    "GracePeriod": null,
    "AttendedConcurrent": false,
    "DevelopmentConcurrent": false,
    "StudioXConcurrent": false,
    "LicensedFeatures": [],
    "IsRegistered": true,
    "IsExpired": false,
    "CreationTime": "2019-11-28T06:16:21.373Z",
    "Code": "d1c8-4785-55ace9a0c233",
    "Allowed": {
        "Unattended": 1,
        "Attended": 1,
        "NonProduction": 0,
        "Development": 1,
        "StudioX": 0
    },
    "Used": {
        "Unattended": 0,
        "Attended": 0,
        "NonProduction": 0,
        "Development": 1,
        "StudioX": 0
    }
}{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#UiPath.Application.Dto.License.LicenseDto",
    "HostLicenseId": null,
    "Id": 0,
    "ExpireDate": 1622678399,
    "GracePeriodEndDate": 1622678399,
    "GracePeriod": null,
    "AttendedConcurrent": false,
    "DevelopmentConcurrent": false,
    "StudioXConcurrent": false,
    "LicensedFeatures": [],
    "IsRegistered": true,
    "IsExpired": false,
    "CreationTime": "2019-11-28T06:16:21.373Z",
    "Code": "d1c8-4785-55ace9a0c233",
    "Allowed": {
        "Unattended": 1,
        "Attended": 1,
        "NonProduction": 0,
        "Development": 1,
        "StudioX": 0
    },
    "Used": {
        "Unattended": 0,
        "Attended": 0,
        "NonProduction": 0,
        "Development": 1,
        "StudioX": 0
    }
}
重要:

最初の認可以降の Orchestrator API 呼び出しはすべて Orchestrator URL に送信する必要があります。

呼び出しに以下のヘッダーが含まれる必要があります。

  • Authorization: Bearer {access_token}
フォルダー内のリソースにアクセスするには、FolderId または FolderPath を HTTP ヘッダーに追加するのを忘れないようにしてください。「API リクエストを構築する」のページをご覧ください。以下に例を示します。
  • X-UIPATH-OrganizationUnitId: {FolderId}
重要:

Note that, for Automation CloudTM Orchestrator services, the results displayed by the API requests are limited to 1,000 entries for each page.

要求で $top パラメーターと $skip パラメーターを使用すると、後続のページを取得できます。たとえば、2,001 件目から 3,000 件目までのロボット ログ エントリを取得するには、GET https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/RobotLogs?$top=1000&$skip=2000 という要求を使用します。

Was this page helpful?

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
UiPath ロゴ (白)
信頼とセキュリティ
© 2005-2024 UiPath. All rights reserved.