How to add headers to "Orchestrator HTTP Request" activity?

Hello, I’m trying to use “Orchestrator HTTP Request” to get Process Schedules. I tried it using Swagger UI and it worked correctly, I just had to add “X-UiPath-OrganizationUnitId”.

However, when I tried to run it from Studio using the activity, I can’t get it to work correctly. It returns status 200 but the results are empty.

Show us the properties of your activity.

Anyway, you can send the headers as JSON in the “JSON Payload” property. I think for the org ID it would look like this:

"{'X-UiPath-OrganizationUnitId':3}"

…obviously, change the value 3 to your actual folder ID.

Hi @Marios_Christou

verify with these steps-

  1. Double-check that you have included the “X-UiPath-OrganizationUnitId” header in your HTTP request in UiPath, just as you did in Swagger UI. This header might be necessary to specify the organization unit from which you want to retrieve schedules.

  2. Verify that the endpoint URL you are using in UiPath matches the one you successfully used in Swagger UI. The URL and any parameters should be identical.

  3. Check how you are handling the response from the HTTP request in UiPath. Ensure that you are correctly parsing the JSON response to extract the data you need.

Thanks!!

There is no header in the Orchestrator HTTP Request activity. That’s why he’s asking how to add headers.

There could be two possible reason
Check on these aspects

  • The X-UiPath-OrganizationUnitIdheader is not being set correctly.
  • The user does not have permission to access the process schedules.

@Marios_Christou

You can use HTTP Request. It needs to install UiPath.WebAPI.Activities.
X-UiPath-OrganizationUnitId = FolderID
So, Orchestrator HTTP Request no need to use X-UiPath-OrganizationUnitId. It needs to choose the folder name.

1 Like

@Marios_Christou

Welcome to the community

X-unit-organizationunitid is nothing but the folder id…

In orchestrator http request you need not add that header…instead choose/give the folder name in the orchestrator folder field…that should suffice for the header part

Hope this helps

Cheers

Thank you, you are correct and it totally makes sense now. I tried adding the folder name in the “Folder Path” field and it works.

Also, I realized that the reason I was getting status 200 but empty results was because without the folder name (And the header I was adding in Json Payload wasn’t doing anything), it was getting the results from the default Personal Workspace folder that didn’t have any triggers, so it was working correctly just for the wrong folder.

1 Like

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