How to start robot dynamically with Orchestrator API?

According to Orchestrator API Guide (https://www.uipath.com/hubfs/Documentation/OrchestratorAPIGuide_2016.2/UiPathOrchestratorAPIGuide_2016.2.html#StartJobs) , I can use the following HTTP POST request to start a job. I need to provide both “ReleaseKey” and “RobotIds” to make it work. Question: How can I start a job dynamically without providing a specific “RobotIds”? I tried to replace “Specific” with “Dynamic”. However, it doesn’t work.

{
“startInfo”: {
“ReleaseKey”: “9e16e6a6-f99a-4d2d-b454-93ae02a69ebc”,
“RobotIds”: [
36, 130
],
“NoOfRobots”: 0,
“Strategy”: “Specific”
}
}

Hi,
im not sure about this, but should you not put “NoOfRobots”: 0, to 1 or more?

Thank you for answer, @MickeyFireMouse. I have tried change “NoOfRobots”, but I got an error response message that tells me I cannot set “NoOfRobots” as other numbers when “Strategy” is “Specific”. So I believe we need to change “Strategy” first.

Here is my HTTP Request Body when I set “NoOfRobots” as 2:
http_body = {
“startInfo”: {
“ReleaseKey”: release_key,
“RobotIds”:[robot_id],
“NoOfRobots”: 2,
“Strategy”: “Specific”
}}

Here is the response:
{“message”:“NoOfRobots should be 0”,“errorCode”:0,“resourceIds”:null}

I assume the Strategy is either Specific or Allocate:
image

However, I’m not sure what the exact value would be if it is not “Allocate”

Thank @ClaytonM. Unfortunately, “Allocate” doesn’t work.

{“message”:“Requested value ‘Allocate’ was not found.”,“errorCode”:0,“resourceIds”:null}

You need to pass it as "Strategy":number_of_times_job_should_execute.
Example-

  • "Strategy":1 means run job 1 time.
  • "Strategy":15 means run job 15 times

Read this for more info.

Did you found a solution for this problem?