Can we have clearer information on our Orchestrators and how to integrate with the Orchestrator API? After much searching i found a post about getting the X-UiPath-OrganizationUnitId:
I don’t see why one should have to do this to build an integration with the Orchestrator API. This seems like a hack. This is not the only thing that is overly complex about integrating with the API. I feel like we should not have to search through system DBs, look at the calls that our hosted orchestrator Ui’s make, or make additional calls to a API to get basic info needed to build an integration.
Getting X-UIPATH-OrganizationUnitId by inspecting the browser request is just a quick way to solve the problem if you just need that number.
In actual applications, the proper way to do it is by making a GET request to /odata/Folders and looking for the ID of the Folder that you want to use.
Note that you can also use OData clauses to restrict the results. For example, to look for the ID of a Folder named Default, you can use GET /odata/Folders?$filter=FullyQualifiedName eq 'Default'&$select=Id, which would bring back something similar to the following response:
Orchestrator cannot change or update the header X-UIPATH-OrganizationUnitId in the future because that would break the backwards compatibility with applications/integrations using it.
Instead, there are new headers that can be used as well, which might make more sense now that Organization Units don’t have the same name.
These new headers are X-UIPATH-FolderPath-Encoded and X-UIPATH-FolderPath, detailed at the top of this page: Building API Requests