How To Get Robot Details Using The /odata/Robots REST API Endpoint?

How to get Robot details using the /odata/Robots REST API endpoint?

Issue Description: In order to get these details, make sure that at the Tenant level, the user has the right to view Robot details.


Verification Steps: For this, verify these steps

  1. Go to Orchestrator -> verify the role that the user is having
  2. Then Go to Orchestrator -> Tenant -> Roles -> Edit the role that you have -> Make sure that View access is present at least to this tenant permissions (Robots, Settings, Folders, Users) -> Update

Example:

1.png

Resolution:

  1. In order to get the Robot details, first you need to obtain a Tenant Bearer Access token (in the below example is the result value). For this, follow below steps,
  • Build a REST API request with method: POST

URL Endpoint: https://ORCHESTRATOR_URL/api/Account/Authenticate

Headers: Content-Type: application/json

Body:

{

"tenancyName":"TENANT_NAME",

"usernameOrEmailAddress":"USERNAME",

"password":"USERNAME_PASSWORD"

}


Example:

  1. Then, run a GET request to this endpoint: https://ORCHESTRATOR_URL/Robots/UiPath.Server.Configuration.OData.GetConfiguredRobots?$top=100&$expand=User&$orderby=User/UserName%20asc

Method: GET

URL endpoint: https://ORCHESTRATOR_URL/odata/Robots/UiPath.Server.Configuration.OData.GetConfiguredRobots?$top=100&$expand=User&$orderby=User/UserName%20asc

Authorization: Tenant Bearer access token from step 1

Headers:

Content-Type: application/json

Example:

11.jpg

Note: As seen, from the above example, the RobotId is 6 ( "Id": 6). In the future REST API requests endpoints, this will be the unique identifier for your desired Robot.