API Return for Orchestrator (X-UIPATH-OrganizationUnitId)

Hi team,
I am able to call API for all the processes under orchestrator. In the endpoint part, feeding the value for X-UiPath-OrganizationUnitId was not mandatory. I can see data for the processes under every folder in orchestrator. However, when I try to send to my SQL’s DB table using integration tool. The X-UiPath-OrganizationUnitId seems mandatory. Is there anything I should be doing in the orchestrator to bypass the Folder ID (X-UiPath-OrganizationUnitId) part? When I manually insert the values like you see below, I can get the data loaded into the DB without any issues.
image (44)
Thanks a lot!

Hi @Sisay_Dinku,

No, the X-UiPath-OrganizationUnitId is a required parameter when using the Orchestrator API. The API is designed to return the processes from a specific folder in the Orchestrator, which is why the folder ID is required. To bypass the folder ID parameter, you could try retrieving the processes from all folders in the Orchestrator and then filtering the results based on your criteria.

Thanks,

@RajKumar_DC thanks for your help. Just for your information. I do not necessarily need the folder id for the API data to be returned. As you might see below. I can get data for all the processes I have under multiple folders.

However, my problem is when I take the API URL and use the third tool (ZappySys + SSIS), it becomes mandatory. Even there if I pass one folder id at a time, I am able to capture the data for all processes under that folder, like the folder id 39 I showed you in the previous post. The issue is when I try to get data for all the processes under all folders at once. The tool I use is called ZappySys. I do not know what configuration is required in orchestrator to allow any tool to help data pass to SQL DB.

Please let me know your thoughts!!

Is there anyone who can help with this?

Thanks a lot!

For accessing resources in a folder, each request must contain either the FolderId or FolderPath in an HTTP header. This header may be encoded (using Base64 UTF-16 encoding) or plain text.

For example:

  • X-UIPATH-OrganizationUnitId "FolderId"
  • X-UIPATH-FolderPath-Encoded "{Encoded FolderPath value}", or
  • X-UIPATH-FolderPath "PlainText FolderPath value"

The FolderId can be obtained by performing a GET request to the /odata/Folders endpoint or from the Orchestrator URL - https://cloud.uipath.com/{organization_ID}/{tenant_name}/orchestrator_/? fid=2032 &tid=8.

If you upgraded and had Organization Units enabled in your previous Orchestrator instance, each OU is migrated as a new Classic folder. Read more about Folders here.

Relative folder paths are supported in an X-UIPATH-FolderPath-Encoded header, as follows:

  • Path starting with / - starts from the root folder of the tree the ambient folder is part of.
  • Path starting with . - starts from the ambient folder.
  • Path starting with .. - starts one level up in the hierarchy of the ambient folder for each .. in the path (e.g. ../ for one level up, ../../ for two levels up in the hierarchy).

Note that trailing slashes are not accepted.

Reference: Building API Requests


In conclusion, you need to provide the Folder name/Folder Id value in case you need to get your Jobs details.

Create a script that will take all the X-UIPATH-FolderPath "PlainText FolderPath value" or X-UIPATH-OrganizationUnitId "FolderId" and based on that values you can insert in other Folder Rest API requests.

I just tested this API call in PostMan. Parameter X-UiPath-OrganizationUnitId is indeed not required.
If X-UiPath-OrganizationUnitId is not provided or empty the call returns all jobs in given tenant.

I do not think there is any special orchestrator setting needed. Orchestrator API works transparently for any client connecting to it.

Therefore I think the problem is in ZappySys component and it’s setting. I do not have experience with ZappySys though.

Cheers

HI @J0ska and @marian.platonov

Thanks for the effort.
I too have no issues of calling in the swagger’s UI, the folder Id is not required. A place where I the requirement folder id is when I am trying do the integration (loading the data from all folders into SQL DB) using ZappySys. I see the following error.

However, that organizationUnitId does not exist under the list of application Scope to set permission for it.

@marian.platonov and @J0ska

When organizationUnitId is manually provided, I have no issues. The problem is the organizationUnitId continue growing as the folder in orchestrator grow.

Did you try removing that orderby part?

Cheers

@J0ska
I did that too but the same issue. Thanks

Do you connect to cloud or on-prem orchestrator?
Is the URL valid? https://cloud.uipath.com/{org}/{Tenant}/orchestrator_/odata/Jobs

And of course: Do you add authorization token to request header?

curl -X GET “https://cloud.uipath.com/{org}/DefaultTenant/orchestrator_/odata/Jobs” -H “accept: application/json” "authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6

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