Get ALL Jobs from ALL folders in Orchestrator via API

Hello everyone, everything good?

I’m trying to make an API call to get data from existing Jobs and Triggers in our orchestrator. I make this call via API using Power Query, like this

let
    Source = Json.Document(
        Web.Contents(
            URL_ORQUESTRADOR & "Jobs?%24top=10",
            [
                Headers = [Authorization = "Bearer " & Access_Token(), #"X-UIPATH-OrganizationUnitId" = "Folder_ID"]
            ]
        )
    ),
    #"Convertido para Tabela" = Record.ToTable(Source),
    Value = #"Convertido para Tabela"{2}[Value],
    #"Convertido para Tabela1" = Table.FromList(Value, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    #"Convertido para Tabela1"

Our processes are separated by folders, so I need to make requests for each one of the folders in our orchestrator.

Is there any way to get data from ALL folders at once?

Make requests by folder is kinda bad for the KPI we are building.

Any help is apreciated

Hi,

If you make the API call to the [orchestrator URL]/odata/jobs endpoint without the X-UiPath-OrganizationUnitId header, you should be able to get jobs data from all folders in Orchestrator.

You can subsequently use the “OrganizationUnitFullyQualifiedName” property in the response to see which folder a Job came from.

Hi @yikwen.goo !

I have tried this solution you are proposing, but i’m getting the error of a Bad Request :frowning:

I sincerely don’t kwow what i’m doing wrong on this API Call. Any help is appreciated

Your URL endpoint should be https://cloud.uipath.com/suzanocoecss/PROD/orchestrator_/oData/Jobs

If it is working, please mark my response as the answer so that others may benefit as well.

Olá Anderson,
Conseguiu resolver o que você precisava, estou a muito tempo com o mesmo problema e nunca cheguei em uma solução.
Obrigado.

Olá!

Mesmo problema aqui, se faço um GET no …/odata/Releases/… ele me retorna errorCode “1101 - É necessária uma unidade organizacional para esta ação”, sendo que a própria doc da UiPath diz que isso ocorre só com POST, por isso estou pensando em iterar todas as folders existentes.

Obrigado.