API organization unit id required


I’m using the orchestrator API to get Jobs “UiPath” when I try it using swagger I can run the query without organization unit id header and get all the jobs across all the folders. When I try the same with postman and the token generated by swagger (after response is received the bearer token is available in curl window) I can also get all the jobs without organization unit is in header. I have configured the external application with application scope set to (OR.Queues OR.Jobs OR.Execution OR.Robots OR.Folders) When I try postman with token generated for my external application I cannot use the “/odata/Jobs” without the organization unit id header anymore every time I try there is an error “An organization unit is required for this action.” I assume that it’s a difference in scopes between swagger and external application but which scope should I add to be able to use “/odata/Jobs” without organization unit id header.

Did you tried in external application to provide organization unit id with null value?

Yes, but it doesn’t work.

Was your application identity/user added to folders where you are checking jobs?

Workaround could be:

Get folders for current user (you can check it swagger, really simple one).
For each folder (you will find ID from first request) get jobs

Thanks for the suggestion it’s something I wasn’t aware before although adding external application to the folders with the same role as my didn’t help. I know about workaround but running ~15 requests instead of one is the last possibility.

I hasnt got that problem because mostly I am using that request by robots in UiPath. Maybe this would help if you want to get to all folders: