StartJobs api call error code 400

I am using postman to test startjob API
But encountered 400 Bad Request
The following are the parameters I use hope you can tell me which side is wrong
(get) {baseURL}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

Headers:
Authorization: Bearer eyJhbGciOi…
Content-Type: application/json;charset=UTF-8
X-UIPATH-OrganizationUnitId: 36644xx
X-UIPATH-TenantName: DefaultTenant
X-UIPATH-FolderPath: Default

Body:
{
“startInfo”: {
“ReleaseKey”: “6aa992f0-b39c-4a0d-b02c-ad16fxxxxxxx”,
“Strategy”: “Specific”,
“RobotIds”: [
938xxx
],
“Source”: “Manual”
}
}

thanks.

Check this example:

Method: POST

URL: https://cloud.uipath.com/ORG_NAME/TENANT_NAME/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

Authorization: Bearer Token → provide the JWT access_token

Headers:

X-UIPATH-OrganizationUnitId: FOLDER_ID/ORG_ID
Accept: application/json
Content-Type: application/json

Body of type JSON:

{
	"startInfo": {
		"ReleaseKey": "d9fa4ce6-0d50-42cb-8af7-109b419aa39a",
		"JobsCount": 1,
		"JobPriority": "Normal",
		"Strategy": "ModernJobsCount",
		"ResumeOnSameContext": false,
		"RuntimeType": "Unattended",
		"InputArguments": "{}",
		"MachineRobots": [
			{
				"RobotId": 714236,
				"MachineId": 1752436
			}
		]
	}
}

More details can be found here: Jobs Requests

Let us know if this helped.

1 Like

it succeeded but got another error code 1015

“message”: “Robots without credentials cannot run processes that require an interactive session.”

It seems that your process cannot run because your robot is not having credentials. It seems you chose an attended robot, not an unattended one with Windows Credentials.

Before playing and testing the API calls in Postman, check how it is looking the correct API call in the back-end. (right-click on the Processes tab page and go to InspectNetwork → look how it looks the /odata/Jobs/UiPath.Server.Configuration.OData.StartJobs request in Headers and the JSON Payload)

Example:

Let us know if this helped.

Thanks, I modified the body by your method, now it is working

{
  "startInfo": {
    "ReleaseKey": "6aa992f0-b39c-4a0d-b02c-ad16f05xxxxx",
    "JobsCount": 1,
    "JobPriority": null,
    "SpecificPriorityValue": null,
    "Strategy": "ModernJobsCount",
    "ResumeOnSameContext": false,
    "RuntimeType": "Unattended",
    "RunAsMe": false,
    "InputArguments": "{'id':'1'}",
    "MachineRobots": [
      {
        "MachineId": 2459xxx
      }
    ]
  }
}
1 Like

Thanks for the update.

Mark as a solution the correct post in this thread that helped to solve your encountered issue.

Where can we get machineID and RobotID?

/odata/Releases and /odata/Machines

Thanks ,can you please hep with parameters that needed to b passed in header and body

X-UIPATH-OrganizationUnitId: FOLDER_ID

Only Machine ID is enough for this? do we need robotID also ?

Please take a look here for more details: Start a job using javascript/nodejs - #5 by marian.platonov

Thanks ,when tried to find robot_id it says “@odata.count”=0.
I have given folder id in the header .

For /odata/Jobs/UiPath.Server.Configuration.OData.StartJobs you need this permission OR.Jobs or OR.Jobs.Write in the External application and Auth Token.

In order to get the ReleaseKey use this endpoint /odata/Releases (OR.Execution or OR.Execution.Read)

In order to get the ROBOT_ID use this endpoint /odata/Robots (OR.Robots or OR.Robots.Read)

If you cannot get your Robots details, use this endpoint:

https://cloud.uipath.com/ORG_NAME/TENANT_NAME/orchestrator_/odata/Robots/UiPath.Server.Configuration.OData.GetConfiguredRobots?$top=1000&$expand=User&$orderby=User/FullName%20asc

In order to get the MACHINE_ID use this endpoint /odata/Machines (OR.Machines or OR.Machines.Read)

Please open your Swagger documentation and check your Orchestrator endpoints and resources:

https://cloud.uipath.com/YOUR_ORG_NAME/YOUR_TENANT_NAME/orchestrator_/swagger/index.html#