Filtering jobs per folder from odata/Jobs API

Hi Forum,

I’m having trouble specifying folders in my HTTP request for getting jobs from orchestrator.
I have succesfully retrieved all folders and their OrganizationUnitIds and Names, but it seems that no matter how i try to use them in the odata/Jobs request, it doesn’t filter. I just get all jobs without filtration.

Anyone who can help me towards a filter method that works?

we recommend to prototype it with swagger

give a try by using expand for release and filter at Release/OrganizationUnitId

can you share with us the details for used / constructed REST Call?

Yes, certainly:

Step 1:

Get Refresh Token

Step 2:

Get Folders with following request:
https://cloud.uipath.com/{{cloudOrg}}/{{cloudTenant}}/orchestrator_/odata/folders”

No headers / filters
Auth with OAuth2 access token

Step 3:

For each folder, i use following http request:
https://cloud.uipath.com/{{cloudOrg}}/{{cloudTenant}}/orchestrator_/odata/Jobs”

Header:
X-UiPath-OrganizationUnitId = CurrentItem(“FullyQualifiedName”).tostring
CurrentItem(“FullyQualifiedName”) refers to the folder name for each folder i loop through.

Again using access token retrieved in step 1 for authentication.

I have not been succesful in adding any filter as i’m having a hard time figuring out how to do so.

I just figured it out… I’m using name and should be using id… My bad

Thank you for your time.

looks more that protoype is done with Postman

https://cloud.uipath.com/cloudOrg/cloudTenant/orchestrator_/swagger

And can try
odata/Jobs?%24expand=Release&%24filter=Release%2FOrganizationUnitId%20eq%20123


123 your filter folder ID

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.