API organization unit id required

Hi,

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:

https://docs.uipath.com/orchestrator/reference/building-api-requests

@Piotr_Wojaczek were you ever able to figure this out?
This difference in behavior between Swagger and an external application (even one that is authorized with every possible Orchestrator permission) is really frustrating.
An endpoint like Releases should never require an organization unit (aka folder) id.
Maybe I’m missing some trick that can make this work, but otherwise I think that this is a bug that should be addressed.