Need a robot account to be able to pull list of all folders via API without being assigned to all folders

I have an automation that pulls some Job metrics. It gets a list of all folders via API, then loops through all the folders and pulls the Job metrics for each folder.

If we run it as a robot that is not assigned to all the folders, we end up with an “object reference not set” exception when it tries to pull the list of folders.

Assigning the robot account to all folders can’t be done, because this will affect any triggers set to “any robot” where we have only certain robots assigned to the folder.

So how can we set up a robot account so that it can pull a list of all Orchestrator folders, and pull a list of Jobs in each folder, without assigning that robot to every folder?

Hi @postwick

The best way I can think of for this scenario would be to setup an external application and fetch details using those creds via http request activity.

And if you are looking to restrict access to this external application, you can also fine-grain the same and allocate this app to only designated folders.

That doesn’t answer my question. I know how to use the API.

Well, there is nuance there Paul.
It depends what role you assign that robot in the folders.

If you don’t give it the ‘Robot’ role or the ‘Automation Viewer’ role then it cannot run jobs.

You could make a role called ‘Job Viewer’ which just has access to view folders and view jobs and then make sure the robot user is assigned to every folder with only these roles.

It will then be able to view job details from any folder, but will only run automations in folders where you also give it the ‘Robot’ or ‘Automation User’ role (or another custom role that has the correct permission to run jobs).