Orchestrator
latest
false
Banner background image
Orchestrator API Guide
Last updated 2024年3月4日

Consuming Cloud API

Overview

UiPath Automation Cloud has two mechanisms for consuming APIs:

  • getting the API access information from Automation Cloud (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 Cloud organization uses the Azure Active Directory model, you must register external applications in Automation Cloud and use the OAuth flow.

Note:

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 Cloud.

On-premises Orchestrator or Orchestrator installed in your private cloud have not been changed. You can continue to use your API integrations, PowerShell or other scripting tools as before when connecting to these Orchestrator instances.

Getting the API Access Information From the Automation Cloud UI

The Services page within your Automation Cloud 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.

Note:

Local users , regardless of their organization-level role, can view API access information for Orchestrator services.

Directory users cannot view API access information for an Orchestrator service as described below. Instead, they must register an external application and use the OAuth flow.

  1. Log in to your Automation Cloud account.
  2. Navigate to Admin > Tenants. The Tenants page lists all existing tenants.
  3. Click the arrow on the left of the desired tenant to display its available services.
  4. Click API Access for the Orchestrator service. The API Access window opens and includes the following service-specific information:
  • User Key - allows you to generate unique login keys to be used with APIs or with 3rd party applications in order to log in and perform actions on your behalf. This was previously known as your refresh token.
  • Organization ID - your organization name. It is the name after the base URL.
  • Tenant Name - the display name of the tenant.
  • Client Id - specific to the Orchestrator application itself, is the same for all users and tenants on a specific platform. For example, all the tenants on https://cloud.uipath.com have the same Client Id value.



Do not close this window. You need the information to make the authentication call. Copy the values by clicking the copy button next to each field.

Authenticating to Your Automation Cloud Based Orchestrator Tenant

The authentication operation sends a POST request to https://account.uipath.com/oauth/token. The request and response should look as in the following example:

POST

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

Request header

Key

Value

Authorization

Bearer

Request body

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

Response code

200 OK

Response body

{
  "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"
}
Note: You obtain the {tenant_name}, {client_ID} and {user_key} values from your API Access page, as described in the previous section.
Copy the {access_token} for later use.
Important: The {access_token} required for making Orchestrator API calls is valid for 24 hours. You have to regenerate {access_token} using your {refresh_token}; otherwise you receive a 401 status code.

Making Orchestrator API Calls

  1. Perform a GET request to https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Settings/UiPath.Server.Configuration.OData.GetLicense
  2. Replace the {organization_name} and {tenant_name} with your values from the API Access page.
  3. Set the Authorization header to Bearer {access_token}, and paste in the {access_token} value received in the procedure above.

After sending the request, you should get a response back from Orchestrator with the license information for this service.

The request and response should look as in the following example:

GET

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

Request header

Key

Value

Authorization

Bearer

Response code

200 OK

Response body

{
    "@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
    }
}
Important:

All Orchestrator API calls subsequent to the initial authorization must go to the Orchestrator URL .

They have to contain the following header:

  • Authorization: Bearer {access_token}
For accessing resources in a folder, remember to add the FolderId or FolderPath in an HTTP header, as explained on the Building API requests page. For example:
  • X-UIPATH-OrganizationUnitId: {FolderId}
Important:

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

You can use $top and $skip parameters in your requests to retrieve subsequent pages. For example, use the GET https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/RobotLogs?$top=1000&$skip=2000 request to retrieve the robot log entries between 2,001 and 3,000.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.