please see the code below for Jobs and Folders , I can pull the Folders fine but for Jobs iam getting error "HTTPError: 400 Client Error: Bad request.
So if i replace “Jobs” with “Folders” in below code I get all the folders.
how can I get it to run for jobs?
++++++++++ JOBS ++++++++++++
import http.client
import requests
import json
can you please guide me more? where can I find “X-UiPath-OrganizationUnitid” ?
and what If i want to pull all the jobs dynamically in an ETL ? I dont have folder ids and I am asked to get all the jobs in UiPath via API
ok I am trying to use the following url for getting all the jobs ran by a particular Robot but its giving me syntax error, I got this syntax from the UI documentation
see there is something fundamentally I am missing . The API URL in my code though working for Folders does not accept this syntax which also apparently is API I am seeing all over web .
Have you looked at Swagger to see how to format the API calls? And why are you doing this with code instead of the Orchestrator HTTP Request activity? If you use the activity you don’t have to worry about manually authenticating.
I have to do it in code as we have external job that runs on AWS Glue.
I am not understanding why this syntax is not working for me and how can I correct it?
like i pointed out that the API syntax I am using is correct for Folders so how can I write it to pull jobs based on the following document ?
ok I used the swagger/index.html for jobs and choose the "execute " option to see what urls it generates and its generating the url that i already had mentioned in the post and its not working .
btw the above syntax from swagger works for folders , so for jobs there has to be something i am missing in the url if someone can kindly point that out.
Something that just hit me, when doing this with Orchestrator HTTP Request it’s folder-specific. Whatever folder you’re connected to in Studio, you’ll get just the jobs for that folder. If I’m trying to get all jobs for all folders, I’d have to first get all the folders, then loop through them and do the job query for each folder. I wonder if you have to do something similar using an external HTTP request. The job property OrganizationUnitId is the id (integer) of the folder the Job ran in.
I am sorry but I am not seeing anywhere in the post how to construct this API call , can you point it? where in the jobs_payload or jobs_url I need to specify the folder for which I am looking for jobs?