API call Jobs status

Hello,

I’m facing difficulties to find a way to get information from a jobs started via API.
Ie, after a startJob, i receive a response like
{

"@odata.context": "https://xxx.xx.xxx.xx/odata/$metadata#Jobs",

"value": [

    {

        "Key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",

        "StartTime": null,

        "EndTime": null,

        "State": "Pending",

        "Source": "Manual",

        "SourceType": "Manual",

        "BatchExecutionKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",

        "Info": null,

        "CreationTime": "2020-07-28T11:45:21.8598644Z",

        "StartingScheduleId": null,

        "ReleaseName": "test_TEST",

        "Type": "Unattended",

        "InputArguments": null,

        "OutputArguments": null,

        "HostMachineName": null,

        "HasMediaRecorded": false,

        "PersistenceId": null,

        "ResumeVersion": null,

        "StopStrategy": null,

        "ReleaseVersionId": null,

        "Id": 58

    }

I know would like to be able to check the STATE of this job though API, but i can’t find any solution anywere… Look like we can only use {{url}}/odata/Jobs?$filter=StartTime ge to filter job list.

If anyone can help a nooby on uipath api calls, many thanks by advance

I forgot to say, i was expecting to be able to filter on other criteras, such as jobID etc

Hello!

You can filter by ID using the same ID that you received in the response when you started the Job.
For example: GET /odata/Jobs?$filter=Id eq 58.
If you want to get only the state, you can use the $select clause as well (GET /odata/Jobs?$filter=Id eq 58&$select=State), which would bring a response like the following:

{
  "@odata.context": "https://cloud.uipath.com/[AccountName]/[ServiceName]/orchestrator_/odata/$metadata#Jobs(State)",
  "@odata.count": 1,
  "value": [
    {
      "State": "Running"
    }
  ]
}

Please check this page for more details: https://docs.uipath.com/orchestrator/reference/building-api-requests

Hello Florian,
In these videos I show how is see the status of Job that is started:
The logic in postman:

The code in NODE JS:

Thanks,
Cristian Negulescu