UiPath API References

Hello Community,

I want to share with you a easy way to use Orchestrator APIs in UiPath. If you are not familiar with Orchestrator APIs, please go to Swagger website. Accesing Swagger you will find all available orchestrator APIs.

In order to access Swagger, please identify if you are using on-promise orchestrator or clould version.

  • on-premise - add the following suffix: /swagger/index.html to your
    Orchestrator URL. For
    example, https://myOrchestrator.com//swagger/index.html.

  • Automation Cloud - add the account and tenant name, as well as
    the /swagger/index.html suffix to the URL. For
    example, UiPath

Swagger View: Display List of Available Orchestrator APIS:

In Swagger, you will be able to execute all APIs available, check APIs documentation, check input parameters (optionals & required) and know output result structure in json or xml format.

As example, get QueueItems for 441296 Queue definition id and limit top as 1

API Response View from Swagger:

Now that we are familiar with all available Orchestrator operations using Swagger, it is highly important verify your access to the APIs in Orchestrator. One initial required information is find our Account Logical Name and Tenant Name

You can find it, following bellow steps:

  1. Go to Orchestrator Admin Section
  2. Click into Tenants Option
  3. Display more option for your Tenant
  4. Click API Access (Cloud Icon)

You can execution the APIs using different tools and techbologies for example Postman or using Axios packages in your Nodejs application, for this example we will use UiPath Automation to execute the Orchestrator API using the UiPath package UiPath.Activities.API

Before you executing desired API, you may invoke API Authentication to retrieve access token, this token will be used in the others API call as part of the body.

In order to retrieve your access token, you need to request a POST in the following End Point:

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

*Specified Tenant Name in Headers (X-UIPATH-TenantName). Use your client id and user key from previous step.

Here is an example of implementation using UiPath Studio:

  1. Use HTTP Request activity, specified Accept format as application/json, use
    https://account.uipath.com/oauth/token as end point, select Post Method. Retrieve outputs from activity Headers, Result and Status Code

  2. Create Body request in String variable and use in request body field
    parameter.
    image

  3. Check if status code = 200, deserialize json using UiPath Activity
    and extract [access_token] from json response.

  4. For any API Call, use your [access token] in Header section
    image

For example, “Get Queue Ids”
UiPath

Get Queue Data

  • Using Skip
    Community edition have a limitation retrieve 1000 transaction per Get Request, in
    order to get all data, you can use skip flag and increase by 1000 until get all your data.

UiPath

  • Without Skip

UiPath)&$expand=Robot,ReviewerUser&$orderby=Id%20desc


UiPath Implementation:

@josueachinchilla kudos . Really useful for starters

1 Like