- 基本情報
- Swagger 定義
- Orchestrator API の使用例
クラウド 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 などのスクリプト ツールをこれまでどおり使用できます。
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 フローを使用する必要があります。
- Log in to your Automation CloudTM account.
- [管理] > [テナント] に移動します。[テナント] ページに、既存のすべてのテナントのリストが表示されます。
- 任意のテナントの左側にある矢印をクリックし、利用可能なサービスを表示します。
- Orchestrator サービスの [API アクセス] をクリックします。 [API アクセス] ウィンドウが開き、サービスに固有な以下の情報が表示されます。
- ユーザー キー - 代わりにログインしてアクションを実行するために API またはサード パーティのアプリケーションで使用する一意のログイン キーを生成できます。これは、以前は更新トークンと呼ばれていました。
- 組織 ID - 組織名です。これはベース URL の後に続く名前です。
- テナント名 - テナントの表示名です。
-
クライアント ID - Orchestrator アプリケーション自体に固有であり、特定のプラットフォーム上のすべてのユーザーおよびテナントで同一です。たとえば、https://cloud.uipath.com 上のすべてのテナントは、同じ値のクライアント ID を持ちます。
このウィンドウを閉じないでください。認証呼び出しを実行するには、この情報が必要です。各フィールドの横にあるコピー ボタン をクリックして、値をコピーします。
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"
}
{tenant_name}
、{client_ID}
、および {user_key}
の値を取得します。
{access_token}
をコピーします。
{access_token}
の有効期限は 24 時間です。{refresh_token}
を使用して {access_token}
を再生成する必要があります。そうしないと、ステータス コード 401 が返されます。
-
https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Settings/UiPath.Server.Configuration.OData.GetLicense
に GET 要求を送信します。 -
{organization_name}
と{tenant_name}
を [API アクセス] ページの値に置き換えます。 -
認可ヘッダーを
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
という要求を使用します。