How to get access_token of the UiPath Orchestrator External App in Microsoft Power Automate?

How to get access_token of the UiPath Orchestrator External App in Microsoft Power Automate?

Issue Description

Let's assume that you have created a confidential application with application scopes for the UiPath.Orchestrator resource and you want to get the access_token in order to perform other UiPath Orchestrator actions using the available API endpoints. See the below image for reference:

References:

Resolution

In order to be able to extract the access_token, the HTTP request connector should look like the below:

Approach #1

'grant_type=client_credentials',

'&client_id=',encodeUriComponent('xxxxxxxxxxxxxxxx),

'&client_secret=',encodeUriComponent('xxxxxxxxxxxxx'),

'&scope=',encodeUriComponent('OR.Queues'))

Approach #2

  • Method: POST
  • URI: https://cloud.uipath.com/identity_/connect/token
  • Headers: Content-Type application/x-www-form-urlencoded
  • Body: grant_type=client_credentials&client_id=YOUR_CLIENT_ID&scope=OR.License%20OR.Robots%20OR.Jobs%20OR.Settings%20OR.Assets%20OR.Robots%20OR.Folders%20OR.Execution%20OR.Monitoring%20OR.Administration%20OR.Queues&client_secret=YOUR_CLIENT_SECRET