How to run a process from Orchestrator API in UIPath?

I am trying to initiate a process from Orchestrator API which has been tested manually from the UIPath Cloud as shown below:

This triggers a command to my UIPath Assistant which then runs the Job successfully. I am unable to find the right endpoint in swagger documentation of processes where I could trigger this job/process from an API call:

Additionally from uiPath postman docs I found to trigger a UIPath Job the body should be something like this:

For obtaining bearer token triggering the following endpoint:

Uri =  https://cloud.uipath.com/identity_/connect/token
// with the following body:
{ grant_type: 'client_credentials',
  client_id: 'f14b5289-c60f-494c-8399-fe204b87058c',
  client_secret: 'iqmk99~~iqLQuEWh',
  scope: 'OR.Tasks OR.BackgroundTasks OR.Execution OR.Jobs OR.Queues' }
>>> cloudUrl = "https://cloud.uipath.com"
>>> uri = f'{cloudUrl}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs'
>>> uri
'https://cloud.uipath.com/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs'
>>> headers = {'Content-Type':'application/json','X-UIPATH-TenantName':'<tenantName>','X-UIPATH-OrganizationUnitId;':'','Authorization': 'Bearer <TokenObtainedInStep1>'}
>>> json = {
    "startInfo": {
        "ReleaseKey": "",
        "Strategy": "ModernJobsCount",
        "JobsCount": 1,
        "InputArguments": "{}"
    }
}
>>> post(uri,json=json,headers=headers)

Hi @spidey ,
To communicate via API, you must know the methods in:

Then if you want to open the swagger, access the link below changing “yourOrgId” and “tenantId” for yours.
https://cloud.uipath.com/{yourOrgId}/{tenantId}/orchestrator_/swagger/index.html

1 Like

Hi @spidey,

Example request to start a job should look like below:

curl --location -g --request POST ‘{{cloudUrl}}/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs’
–header ‘Content-Type: application/json’
–header ‘X-UIPATH-TenantName: {{tenantName}}’
–header ‘X-UIPATH-OrganizationUnitId;’
–data-raw ‘{
“startInfo”: {
“ReleaseKey”: “”,
“Strategy”: “ModernJobsCount”,
“JobsCount”: 1,
“InputArguments”: “{}”
}
}’

Please verify this with what you are supplying.

For more details, refer below section in the link shared in above post.

Regards
Sonali

Hi

Here you go with a knowledge base from our forum

Cheers @spidey

1 Like

In this solution, I don’t see any Job Id which can be supplied. Additionally this acts upon an authentication layer which is also something I am not getting correctly.

Can you give an example?

Saw what you shared, tried that method as well didn’t work. Have added the comment in the same forum thread.