Start A Job On Specific Machine Using Modern Folder Via API Call

How to start a job on specific machine using modern folder via API call?

Follow the steps below:

  1. In Modern Folder robots are auto provisioned from user. Those data can be found using below API endpoint.
  • https://[Orchestrator-URL]/odata/Users
  1. Get the RobotId mentioned in the response under Unattended Robot.
  2. Next for getting Machine session Id, follow the steps,
    1. Call the API - https://[orchestratorUrl]/odata/Machines
    2. Get all the machines and templates available in Orchestrator with their ID's.
    3. Copy the Id of the machine template with which the machine Robot is connected and call the other API - https://[orchestratorUrl]/odata/sessions/UiPath.Server.Configuration.OData.GetMachineSessions(key=x) , where x is the Id copied.
    4. Get all the machines details connected with that template. Now the mentioned Id for the specific machine is the MachineSessionId.
  3. Now use the below parameters in request body and replace them with required details

{

"startInfo":

{"ReleaseKey":"5044d864-fd5b-498f-a7a6-f63685daaba1",

"RobotIds":[6],

"MachineSessionIds":[4],

"JobsCount":1,

"JobPriority":"Normal",

"Strategy":"ModernJobsCount",

"RuntimeType":"NonProduction",

"InputArguments":"{}"

}}

Note: Change the RuntimeType if there is allocated Unattended Robot.

2 Likes