orchestrator
latest
false
  • 入门指南
  • Swagger 定义
  • Orchestrator API
Orchestrator API 指南
Automation CloudAutomation Cloud Public SectorAutomation SuiteStandalone
Last updated 2024年10月9日

作业请求

请求由特定机器人启动的作业

根据机器人 ID

如以下示例所示,我们请求了前 3 个作业,但仅返回 1 个作业,因为仅找到一个作业在 ID 为 749 的机器人上运行。

获取

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs?$top=3&$filter=Robot/Id eq 749

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "@odata.count": 13,
    "value": [
        {
            "Key": "1c7222dc-416f-4c60-9b17-88262c91768f",
            "StartTime": "2018-01-15T18:18:02.79Z",
            "EndTime": "2018-01-15T18:18:47.587Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "8c5302a7-8ed3-458a-ab64-34cc72fdd709",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:18:01.623Z",
            "StartingScheduleId": null,
            "Id": 125161
        },
        {
            "Key": "9fbdfca0-d1e5-41c2-abe6-86fe626346a3",
            "StartTime": "2018-03-02T17:25:35.17Z",
            "EndTime": "2018-03-02T17:25:46.62Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "9b908e73-b564-4022-92cb-9e9f0571c2ec",
            "Info": "Job completed",
            "CreationTime": "2018-03-02T17:25:34.087Z",
            "StartingScheduleId": null,
            "Id": 127283
        },
        {
            "Key": "e29e472d-5d51-4369-9c15-af867e6dd580",
            "StartTime": "2018-03-05T18:27:27.123Z",
            "EndTime": "2018-03-05T18:27:38.593Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "ad498d35-326c-4c6c-89d0-16fb73abd0c8",
            "Info": "Execution error : System.ArgumentException: The sheet does not exist\r\n   at UiPath.Excel.WorkbookApplication.SetSheet(String sheetName, Boolean createNew)\r\n   at UiPath.Excel.Activities.ExcelInteropActivity`1.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)\r\n   at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)\r\n   at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)\r\n   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)",
            "CreationTime": "2018-03-05T18:27:25.793Z",
            "StartingScheduleId": null,
            "Id": 127416
        }
    ]
}{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "@odata.count": 13,
    "value": [
        {
            "Key": "1c7222dc-416f-4c60-9b17-88262c91768f",
            "StartTime": "2018-01-15T18:18:02.79Z",
            "EndTime": "2018-01-15T18:18:47.587Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "8c5302a7-8ed3-458a-ab64-34cc72fdd709",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:18:01.623Z",
            "StartingScheduleId": null,
            "Id": 125161
        },
        {
            "Key": "9fbdfca0-d1e5-41c2-abe6-86fe626346a3",
            "StartTime": "2018-03-02T17:25:35.17Z",
            "EndTime": "2018-03-02T17:25:46.62Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "9b908e73-b564-4022-92cb-9e9f0571c2ec",
            "Info": "Job completed",
            "CreationTime": "2018-03-02T17:25:34.087Z",
            "StartingScheduleId": null,
            "Id": 127283
        },
        {
            "Key": "e29e472d-5d51-4369-9c15-af867e6dd580",
            "StartTime": "2018-03-05T18:27:27.123Z",
            "EndTime": "2018-03-05T18:27:38.593Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "ad498d35-326c-4c6c-89d0-16fb73abd0c8",
            "Info": "Execution error : System.ArgumentException: The sheet does not exist\r\n   at UiPath.Excel.WorkbookApplication.SetSheet(String sheetName, Boolean createNew)\r\n   at UiPath.Excel.Activities.ExcelInteropActivity`1.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)\r\n   at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)\r\n   at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)\r\n   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)",
            "CreationTime": "2018-03-05T18:27:25.793Z",
            "StartingScheduleId": null,
            "Id": 127416
        }
    ]
}

根据机器人名称

此调用请求名称为“DocBot”的机器人执行的所有前 10 个作业,但由于仅找到一个作业,因此仅返回 1 个。

获取

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs?$top=10&$filter=Robot/Name eq 'DocBot'

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "@odata.count": 1,
    "value": [
        {
            "Key": "1c7222dc-416f-4c60-9b17-88262c91768f",
            "StartTime": "2018-01-15T18:18:02.79Z",
            "EndTime": "2018-01-15T18:18:47.587Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "8c5302a7-8ed3-458a-ab64-34cc72fdd709",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:18:01.623Z",
            "StartingScheduleId": null,
            "Id": 125161
        }
    ]
}{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "@odata.count": 1,
    "value": [
        {
            "Key": "1c7222dc-416f-4c60-9b17-88262c91768f",
            "StartTime": "2018-01-15T18:18:02.79Z",
            "EndTime": "2018-01-15T18:18:47.587Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "8c5302a7-8ed3-458a-ab64-34cc72fdd709",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:18:01.623Z",
            "StartingScheduleId": null,
            "Id": 125161
        }
    ]
}

根据具有特定状态的特定机器人 ID

以下示例查找由 ID 为 749 的机器人处理并处于“成功”状态的前 10 个作业。 如您所见,仅返回了两个结果。

获取

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs?$top=10&$filter=Robot/Id eq 749 and State eq 'Successful'

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/$metadata#Jobs",
    "@odata.count": 2,
    "value": [
        {
            "Key": "1c7222dc-416f-4c60-9b17-88262c91768f",
            "StartTime": "2018-01-15T18:18:02.79Z",
            "EndTime": "2018-01-15T18:18:47.587Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "8c5302a7-8ed3-458a-ab64-34cc72fdd709",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:18:01.623Z",
            "StartingScheduleId": null,
            "Id": 125161
        },
        {
            "Key": "9fbdfca0-d1e5-41c2-abe6-86fe626346a3",
            "StartTime": "2018-03-02T17:25:35.17Z",
            "EndTime": "2018-03-02T17:25:46.62Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "9b908e73-b564-4022-92cb-9e9f0571c2ec",
            "Info": "Job completed",
            "CreationTime": "2018-03-02T17:25:34.087Z",
            "StartingScheduleId": null,
            "Id": 127283
        }
    ]
}{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/$metadata#Jobs",
    "@odata.count": 2,
    "value": [
        {
            "Key": "1c7222dc-416f-4c60-9b17-88262c91768f",
            "StartTime": "2018-01-15T18:18:02.79Z",
            "EndTime": "2018-01-15T18:18:47.587Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "8c5302a7-8ed3-458a-ab64-34cc72fdd709",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:18:01.623Z",
            "StartingScheduleId": null,
            "Id": 125161
        },
        {
            "Key": "9fbdfca0-d1e5-41c2-abe6-86fe626346a3",
            "StartTime": "2018-03-02T17:25:35.17Z",
            "EndTime": "2018-03-02T17:25:46.62Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "9b908e73-b564-4022-92cb-9e9f0571c2ec",
            "Info": "Job completed",
            "CreationTime": "2018-03-02T17:25:34.087Z",
            "StartingScheduleId": null,
            "Id": 127283
        }
    ]
}

根据机器人 ID 和结束日期

通过以下示例,您可以查找由 ID 为 759 的机器人执行并在 2018 年 2 月 22 日 10:00:00.837 之后完成运行的前 10 个作业。 由于只有三个作业与所有这些参数匹配,因此“ 响应 ”部分中仅返回了这些参数。

获取

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs?$top=10&$filter=Robot/Id eq 759 and EndTime lt 2018-02-22T10:00:00.837Z

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "@odata.count": 3,
    "value": [
        {
            "Key": "45383b6c-a547-49e1-be5c-f3bb6d78982c",
            "StartTime": "2018-01-15T18:17:14.693Z",
            "EndTime": "2018-01-15T18:17:14.693Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "9eda64eb-3ab8-46e8-833d-fe944a4eb25e",
            "Info": "Logon failure: unknown user name or bad password",
            "CreationTime": "2018-01-15T18:17:13.59Z",
            "StartingScheduleId": null,
            "Id": 125160
        },
        {
            "Key": "4b018719-36cb-43a1-8096-202641ccee62",
            "StartTime": "2018-01-15T18:19:03.177Z",
            "EndTime": "2018-01-15T18:19:03.177Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "7a60ce9d-a5a6-4e9f-b908-ab5819b016c2",
            "Info": "Logon failure: unknown user name or bad password",
            "CreationTime": "2018-01-15T18:19:02.37Z",
            "StartingScheduleId": null,
            "Id": 125162
        },
        {
            "Key": "4420820e-7b0a-49a3-a172-ddcc1d88ace9",
            "StartTime": "2018-01-15T18:20:07.93Z",
            "EndTime": "2018-01-15T18:20:22.68Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "843d9f41-ae7b-4a28-bd32-d57006f90a2f",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:20:06.733Z",
            "StartingScheduleId": null,
            "Id": 125163
        }
    ]
}{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "@odata.count": 3,
    "value": [
        {
            "Key": "45383b6c-a547-49e1-be5c-f3bb6d78982c",
            "StartTime": "2018-01-15T18:17:14.693Z",
            "EndTime": "2018-01-15T18:17:14.693Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "9eda64eb-3ab8-46e8-833d-fe944a4eb25e",
            "Info": "Logon failure: unknown user name or bad password",
            "CreationTime": "2018-01-15T18:17:13.59Z",
            "StartingScheduleId": null,
            "Id": 125160
        },
        {
            "Key": "4b018719-36cb-43a1-8096-202641ccee62",
            "StartTime": "2018-01-15T18:19:03.177Z",
            "EndTime": "2018-01-15T18:19:03.177Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "7a60ce9d-a5a6-4e9f-b908-ab5819b016c2",
            "Info": "Logon failure: unknown user name or bad password",
            "CreationTime": "2018-01-15T18:19:02.37Z",
            "StartingScheduleId": null,
            "Id": 125162
        },
        {
            "Key": "4420820e-7b0a-49a3-a172-ddcc1d88ace9",
            "StartTime": "2018-01-15T18:20:07.93Z",
            "EndTime": "2018-01-15T18:20:22.68Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "843d9f41-ae7b-4a28-bd32-d57006f90a2f",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:20:06.733Z",
            "StartingScheduleId": null,
            "Id": 125163
        }
    ]
}

根据开始日期和机器人 ID

以下查询搜索从 2017 年 9 月 22 日 09:59:22.837 开始,由 ID 为 749 的机器人执行的前 10 个作业。

获取

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs?$top=10&$filter=Robot/Id eq 749 and State eq 'Successful'

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/$metadata#Jobs",
    "@odata.count": 2,
    "value": [
        {
            "Key": "1c7222dc-416f-4c60-9b17-88262c91768f",
            "StartTime": "2018-01-15T18:18:02.79Z",
            "EndTime": "2018-01-15T18:18:47.587Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "8c5302a7-8ed3-458a-ab64-34cc72fdd709",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:18:01.623Z",
            "StartingScheduleId": null,
            "Id": 125161
        },
        {
            "Key": "9fbdfca0-d1e5-41c2-abe6-86fe626346a3",
            "StartTime": "2018-03-02T17:25:35.17Z",
            "EndTime": "2018-03-02T17:25:46.62Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "9b908e73-b564-4022-92cb-9e9f0571c2ec",
            "Info": "Job completed",
            "CreationTime": "2018-03-02T17:25:34.087Z",
            "StartingScheduleId": null,
            "Id": 127283
        }
    ]
}{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/$metadata#Jobs",
    "@odata.count": 2,
    "value": [
        {
            "Key": "1c7222dc-416f-4c60-9b17-88262c91768f",
            "StartTime": "2018-01-15T18:18:02.79Z",
            "EndTime": "2018-01-15T18:18:47.587Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "8c5302a7-8ed3-458a-ab64-34cc72fdd709",
            "Info": "Job completed",
            "CreationTime": "2018-01-15T18:18:01.623Z",
            "StartingScheduleId": null,
            "Id": 125161
        },
        {
            "Key": "9fbdfca0-d1e5-41c2-abe6-86fe626346a3",
            "StartTime": "2018-03-02T17:25:35.17Z",
            "EndTime": "2018-03-02T17:25:46.62Z",
            "State": "Successful",
            "Source": "Manual",
            "BatchExecutionKey": "9b908e73-b564-4022-92cb-9e9f0571c2ec",
            "Info": "Job completed",
            "CreationTime": "2018-03-02T17:25:34.087Z",
            "StartingScheduleId": null,
            "Id": 127283
        }
    ]
}

开始作业

以下请求使您能够在关联环境中的所有可用机器人上开始执行指定的流程(通过 ReleaseKey 参数)。

注意:全部” 策略不适用于新式文件夹。

发布

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

请求标头

密钥

授权

承载

请求正文

{
  "startInfo": {
    "ReleaseKey": "795cbab2-8008-4a54-b1cb-f9ff1ece139e",
    "Strategy": "All",
    "RobotIds": [],
    "NoOfRobots": 0
  }
}{
  "startInfo": {
    "ReleaseKey": "795cbab2-8008-4a54-b1cb-f9ff1ece139e",
    "Strategy": "All",
    "RobotIds": [],
    "NoOfRobots": 0
  }
}

响应代码

200 OK

响应正文

{
  "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
  "value": [
    {
      "Key": "31ade17f-5a35-4250-beea-43922dc2a20d",
      "StartTime": null,
      "EndTime": null,
      "State": "Pending",
      "Source": "Manual",
      "BatchExecutionKey": "cbaff1c6-32b0-468b-9ad9-b59f9ca1d3b6",
      "Info": null,
      "CreationTime": "2018-03-19T19:01:58.6806126Z",
      "StartingScheduleId": null,
      "Id": 128209
    },
    {
      "Key": "c4caf051-9db6-486d-8078-231f9dec1a4c",
      "StartTime": null,
      "EndTime": null,
      "State": "Pending",
      "Source": "Manual",
      "BatchExecutionKey": "cbaff1c6-32b0-468b-9ad9-b59f9ca1d3b6",
      "Info": null,
      "CreationTime": "2018-03-19T19:01:58.7610094Z",
      "StartingScheduleId": null,
      "Id": 128210
    },
    {
      "Key": "969552ba-cfe5-4e87-adde-c85a358ae96f",
      "StartTime": null,
      "EndTime": null,
      "State": "Pending",
      "Source": "Manual",
      "BatchExecutionKey": "cbaff1c6-32b0-468b-9ad9-b59f9ca1d3b6",
      "Info": null,
      "CreationTime": "2018-03-19T19:01:58.8212679Z",
      "StartingScheduleId": null,
      "Id": 128211
    }
  ]
}{
  "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
  "value": [
    {
      "Key": "31ade17f-5a35-4250-beea-43922dc2a20d",
      "StartTime": null,
      "EndTime": null,
      "State": "Pending",
      "Source": "Manual",
      "BatchExecutionKey": "cbaff1c6-32b0-468b-9ad9-b59f9ca1d3b6",
      "Info": null,
      "CreationTime": "2018-03-19T19:01:58.6806126Z",
      "StartingScheduleId": null,
      "Id": 128209
    },
    {
      "Key": "c4caf051-9db6-486d-8078-231f9dec1a4c",
      "StartTime": null,
      "EndTime": null,
      "State": "Pending",
      "Source": "Manual",
      "BatchExecutionKey": "cbaff1c6-32b0-468b-9ad9-b59f9ca1d3b6",
      "Info": null,
      "CreationTime": "2018-03-19T19:01:58.7610094Z",
      "StartingScheduleId": null,
      "Id": 128210
    },
    {
      "Key": "969552ba-cfe5-4e87-adde-c85a358ae96f",
      "StartTime": null,
      "EndTime": null,
      "State": "Pending",
      "Source": "Manual",
      "BatchExecutionKey": "cbaff1c6-32b0-468b-9ad9-b59f9ca1d3b6",
      "Info": null,
      "CreationTime": "2018-03-19T19:01:58.8212679Z",
      "StartingScheduleId": null,
      "Id": 128211
    }
  ]
}

使用输入参数的自定义值启动作业

以下对 /odata/Jobs/UiPath.Server.Configuration.OData.StartJobs 端点的 POST 请求使您能够为输入参数添加自定义值,同时还可以在特定机器人上启动作业。
备注:

对于 API 调用,全部输入参数的 JSON 表示不得超过 10,000 个字符,包括参数名称、所有转义字符、空格、方括号和参数值。

如果您在进行启动作业 API 调用时提供了整数输入参数的值,这些值也是有效的 ASCII 值,请注意,这些值已更改。 例如, 0065 变为 53

发布

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

请求标头

密钥

授权

承载

请求正文

{
    "startInfo": {
        "ReleaseKey": "429cf1cc-283c-424f-a935-43f72c2ca719",
        "RobotIds": [121],
        "JobsCount": 0,
        "Strategy": "Specific",
        "InputArguments": "{\"age\":33,\"trueOrFalse\":false,\"stringNew\":\"testing\"}"
    }
}{
    "startInfo": {
        "ReleaseKey": "429cf1cc-283c-424f-a935-43f72c2ca719",
        "RobotIds": [121],
        "JobsCount": 0,
        "Strategy": "Specific",
        "InputArguments": "{\"age\":33,\"trueOrFalse\":false,\"stringNew\":\"testing\"}"
    }
}

响应代码

200 OK

响应正文

{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "value": [
        {
            "Key": "0fbdbecb-3677-4c33-a491-a1f7ed4ff886",
            "StartTime": null,
            "EndTime": null,
            "State": "Pending",
            "Source": "Manual",
            "SourceType": "Manual",
            "BatchExecutionKey": "e188f409-c504-47b7-b2cf-30b8fe423f87",
            "Info": null,
            "CreationTime": "2018-08-27T16:41:00.4773869Z",
            "StartingScheduleId": null,
            "ReleaseName": "input_output_test_DocEnv",
            "Type": "Unattended",
            "InputArguments": "{\"age\":33,\"trueOrFalse\":false,\"stringNew\":\"testing\"}",
            "OutputArguments": null,
            "Id": 21767
        }
    ]
}{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "value": [
        {
            "Key": "0fbdbecb-3677-4c33-a491-a1f7ed4ff886",
            "StartTime": null,
            "EndTime": null,
            "State": "Pending",
            "Source": "Manual",
            "SourceType": "Manual",
            "BatchExecutionKey": "e188f409-c504-47b7-b2cf-30b8fe423f87",
            "Info": null,
            "CreationTime": "2018-08-27T16:41:00.4773869Z",
            "StartingScheduleId": null,
            "ReleaseName": "input_output_test_DocEnv",
            "Type": "Unattended",
            "InputArguments": "{\"age\":33,\"trueOrFalse\":false,\"stringNew\":\"testing\"}",
            "OutputArguments": null,
            "Id": 21767
        }
    ]
}

检索由指定环境执行的作业

以下示例使我们能够获取由属于环境一部分的具有 312 ID 的机器人执行的前两个作业,并扩展流程信息。

获取

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs?$top=2&$expand=Release&$filter=Release/EnvironmentId eq 312

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "@odata.count": 26,
    "value": [
        {
            "Key": "d3780aac-1e80-49b0-bfd3-c8ec6a3939db",
            "StartTime": "2018-01-15T18:03:42.51Z",
            "EndTime": "2018-01-15T18:03:44.353Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "c08beec5-243c-4e08-854d-7c100cd35214",
            "Info": "Logon failure: unknown user name or bad password",
            "CreationTime": "2018-01-15T18:03:41.56Z",
            "StartingScheduleId": null,
            "Id": 125153,
            "Release": {
                "Key": "766d80d3-cc02-4635-b36c-e30fcf1008b1",
                "ProcessKey": "Release_Project",
                "ProcessVersion": "",
                "IsLatestVersion": false,
                "IsProcessDeleted": false,
                "Description": "rockerii",
                "Name": "Release_Project_doc_env",
                "EnvironmentId": 312,
                "EnvironmentName": null,
                "Id": 440
            }
        },
        {
            "Key": "93b0bfc1-cb80-4594-bb3e-9f35f3efc828",
            "StartTime": "2018-01-15T18:05:42.393Z",
            "EndTime": "2018-01-15T18:05:42.393Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "2f894a2b-7ba1-4eee-b399-c67894a9b3ec",
            "Info": "Logon failure: unknown user name or bad password",
            "CreationTime": "2018-01-15T18:05:41.093Z",
            "StartingScheduleId": null,
            "Id": 125154,
            "Release": {
                "Key": "766d80d3-cc02-4635-b36c-e30fcf1008b1",
                "ProcessKey": "Release_Project",
                "ProcessVersion": "",
                "IsLatestVersion": false,
                "IsProcessDeleted": false,
                "Description": "rockerii",
                "Name": "Release_Project_doc_env",
                "EnvironmentId": 312,
                "EnvironmentName": null,
                "Id": 440
            }
        }
    ]
}{
    "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
    "@odata.count": 26,
    "value": [
        {
            "Key": "d3780aac-1e80-49b0-bfd3-c8ec6a3939db",
            "StartTime": "2018-01-15T18:03:42.51Z",
            "EndTime": "2018-01-15T18:03:44.353Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "c08beec5-243c-4e08-854d-7c100cd35214",
            "Info": "Logon failure: unknown user name or bad password",
            "CreationTime": "2018-01-15T18:03:41.56Z",
            "StartingScheduleId": null,
            "Id": 125153,
            "Release": {
                "Key": "766d80d3-cc02-4635-b36c-e30fcf1008b1",
                "ProcessKey": "Release_Project",
                "ProcessVersion": "",
                "IsLatestVersion": false,
                "IsProcessDeleted": false,
                "Description": "rockerii",
                "Name": "Release_Project_doc_env",
                "EnvironmentId": 312,
                "EnvironmentName": null,
                "Id": 440
            }
        },
        {
            "Key": "93b0bfc1-cb80-4594-bb3e-9f35f3efc828",
            "StartTime": "2018-01-15T18:05:42.393Z",
            "EndTime": "2018-01-15T18:05:42.393Z",
            "State": "Faulted",
            "Source": "Manual",
            "BatchExecutionKey": "2f894a2b-7ba1-4eee-b399-c67894a9b3ec",
            "Info": "Logon failure: unknown user name or bad password",
            "CreationTime": "2018-01-15T18:05:41.093Z",
            "StartingScheduleId": null,
            "Id": 125154,
            "Release": {
                "Key": "766d80d3-cc02-4635-b36c-e30fcf1008b1",
                "ProcessKey": "Release_Project",
                "ProcessVersion": "",
                "IsLatestVersion": false,
                "IsProcessDeleted": false,
                "Description": "rockerii",
                "Name": "Release_Project_doc_env",
                "EnvironmentId": 312,
                "EnvironmentName": null,
                "Id": 440
            }
        }
    ]
}

根据错误检索故障作业

下面的调用可帮助您显示前 2 个因“登录失败:未知用户名或密码错误”错误而失败的作业,并展开机器人和流程详细信息。 您可以将此查询用于“ 作业详细信息 ” 窗口中显示的任何类型的错误。

获取

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs?$filter=(CreationTime gt 2017-01-01T00:00:00.000Z and State eq '4' and indexof(Info,'Logon failure: unknown user name or bad password') ne -1)&$expand=Robot,Release&$top=2

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
  "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
  "@odata.count": 5,
  "value": [
    {
      "Key": "d3780aac-1e80-49b0-bfd3-c8ec6a3939db",
      "StartTime": "2018-01-15T18:03:42.51Z",
      "EndTime": "2018-01-15T18:03:44.353Z",
      "State": "Faulted",
      "Source": "Manual",
      "BatchExecutionKey": "c08beec5-243c-4e08-854d-7c100cd35214",
      "Info": "Logon failure: unknown user name or bad password",
      "CreationTime": "2018-01-15T18:03:41.56Z",
      "StartingScheduleId": null,
      "Id": 125153,
      "Robot": {
        "LicenseKey": null,
        "MachineName": "DESKTOP-PMFQGCB",
        "Name": "RoboDrulea",
        "Username": "ALEX",
        "Description": null,
        "Type": "Unattended",
        "Password": null,
        "RobotEnvironments": "",
        "Id": 758,
        "ExecutionSettings": null
      },
      "Release": {
        "Key": "766d80d3-cc02-4635-b36c-e30fcf1008b1",
        "ProcessKey": "Release_Project",
        "ProcessVersion": "",
        "IsLatestVersion": false,
        "IsProcessDeleted": false,
        "Description": null,
        "Name": "Release_Project_doc_env",
        "EnvironmentId": 312,
        "EnvironmentName": null,
        "Id": 440
      }
    },
    {
      "Key": "93b0bfc1-cb80-4594-bb3e-9f35f3efc828",
      "StartTime": "2018-01-15T18:05:42.393Z",
      "EndTime": "2018-01-15T18:05:42.393Z",
      "State": "Faulted",
      "Source": "Manual",
      "BatchExecutionKey": "2f894a2b-7ba1-4eee-b399-c67894a9b3ec",
      "Info": "Logon failure: unknown user name or bad password",
      "CreationTime": "2018-01-15T18:05:41.093Z",
      "StartingScheduleId": null,
      "Id": 125154,
      "Robot": {
        "LicenseKey": null,
        "MachineName": "DESKTOP-PMFQGCB",
        "Name": "RoboDrulea",
        "Username": "ALEX",
        "Description": null,
        "Type": "Unattended",
        "Password": null,
        "RobotEnvironments": "",
        "Id": 758,
        "ExecutionSettings": null
      },
      "Release": {
        "Key": "766d80d3-cc02-4635-b36c-e30fcf1008b1",
        "ProcessKey": "Release_Project",
        "ProcessVersion": "",
        "IsLatestVersion": false,
        "IsProcessDeleted": false,
        "Description": null,
        "Name": "Release_Project_doc_env",
        "EnvironmentId": 312,
        "EnvironmentName": null,
        "Id": 440
      }
    }
  ]
}{
  "@odata.context": "https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Jobs",
  "@odata.count": 5,
  "value": [
    {
      "Key": "d3780aac-1e80-49b0-bfd3-c8ec6a3939db",
      "StartTime": "2018-01-15T18:03:42.51Z",
      "EndTime": "2018-01-15T18:03:44.353Z",
      "State": "Faulted",
      "Source": "Manual",
      "BatchExecutionKey": "c08beec5-243c-4e08-854d-7c100cd35214",
      "Info": "Logon failure: unknown user name or bad password",
      "CreationTime": "2018-01-15T18:03:41.56Z",
      "StartingScheduleId": null,
      "Id": 125153,
      "Robot": {
        "LicenseKey": null,
        "MachineName": "DESKTOP-PMFQGCB",
        "Name": "RoboDrulea",
        "Username": "ALEX",
        "Description": null,
        "Type": "Unattended",
        "Password": null,
        "RobotEnvironments": "",
        "Id": 758,
        "ExecutionSettings": null
      },
      "Release": {
        "Key": "766d80d3-cc02-4635-b36c-e30fcf1008b1",
        "ProcessKey": "Release_Project",
        "ProcessVersion": "",
        "IsLatestVersion": false,
        "IsProcessDeleted": false,
        "Description": null,
        "Name": "Release_Project_doc_env",
        "EnvironmentId": 312,
        "EnvironmentName": null,
        "Id": 440
      }
    },
    {
      "Key": "93b0bfc1-cb80-4594-bb3e-9f35f3efc828",
      "StartTime": "2018-01-15T18:05:42.393Z",
      "EndTime": "2018-01-15T18:05:42.393Z",
      "State": "Faulted",
      "Source": "Manual",
      "BatchExecutionKey": "2f894a2b-7ba1-4eee-b399-c67894a9b3ec",
      "Info": "Logon failure: unknown user name or bad password",
      "CreationTime": "2018-01-15T18:05:41.093Z",
      "StartingScheduleId": null,
      "Id": 125154,
      "Robot": {
        "LicenseKey": null,
        "MachineName": "DESKTOP-PMFQGCB",
        "Name": "RoboDrulea",
        "Username": "ALEX",
        "Description": null,
        "Type": "Unattended",
        "Password": null,
        "RobotEnvironments": "",
        "Id": 758,
        "ExecutionSettings": null
      },
      "Release": {
        "Key": "766d80d3-cc02-4635-b36c-e30fcf1008b1",
        "ProcessKey": "Release_Project",
        "ProcessVersion": "",
        "IsLatestVersion": false,
        "IsProcessDeleted": false,
        "Description": null,
        "Name": "Release_Project_doc_env",
        "EnvironmentId": 312,
        "EnvironmentName": null,
        "Id": 440
      }
    }
  ]
}

停止多个作业

下面的请求使我们能够强制停止(终止)两个作业。

备注:
可以使用以下值填充 strategy 参数:
  • SoftStop1
  • Kill or 2.

发布

https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StopJobs

请求标头

密钥

授权

承载

请求正文

{
    "jobIds": [22450719, 22450728],
    "strategy": "1"
}{
    "jobIds": [22450719, 22450728],
    "strategy": "1"
}

响应代码

200 OK

导出作业

此操作需要调用各个端点。

备注:

此端点限制为每个租户每天 100 个 API 请求。

  1. 通过调用 POST https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/ /odata/Jobs/UiPath.Server.Configuration.OData.Export 来启动导出。根据需要添加筛选器。

    请求正文如下所示:

    POST https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.Export?$top=1000&$expand=Robot,Machine,Release&$orderby=CreationTime%20desc HTTP/1.1
    Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
    X-Uipath-Organizationunitid: 770643POST https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.Export?$top=1000&$expand=Robot,Machine,Release&$orderby=CreationTime%20desc HTTP/1.1
    Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
    X-Uipath-Organizationunitid: 770643

    响应包含后续步骤所需的 ID:

    {"@odata.context":"https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Exports/$entity","Id":8661,"Name":"jobs-02c0398c-227b-47f4-aade-2252146d7d8f","Type":"Jobs","Status":"New","RequestedAt":"2024-01-15T07:48:34.8805788Z","ExecutedAt":null,"Size":null}{"@odata.context":"https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Exports/$entity","Id":8661,"Name":"jobs-02c0398c-227b-47f4-aade-2252146d7d8f","Type":"Jobs","Status":"New","RequestedAt":"2024-01-15T07:48:34.8805788Z","ExecutedAt":null,"Size":null}
  2. 通过调用 GET https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/orchestrator_/odata/Exports(8661) 来获取请求状态,其中括号之间的文本是在第 1 步中返回的 ID。

    请求正文如下所示:

    GET https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Exports(8661) HTTP/1.1
    Host: alpha.uipath.com
    Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
    X-Uipath-Organizationunitid: 770643
    Cookie: __cf_bm=lxqtVnB6oC_KS1nxJsWcqGK87Up9b5TGUCkZLeoaLP8-1705304914-1-AcpGG76FE03iiFdCw+u2Sq/xV3T38gqfvE7vjjZ5YHs5Iwjmrw1/1DjR5RSlqdQU1ocpukAZ1I0JLAGnkdOnumA=GET https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Exports(8661) HTTP/1.1
    Host: alpha.uipath.com
    Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
    X-Uipath-Organizationunitid: 770643
    Cookie: __cf_bm=lxqtVnB6oC_KS1nxJsWcqGK87Up9b5TGUCkZLeoaLP8-1705304914-1-AcpGG76FE03iiFdCw+u2Sq/xV3T38gqfvE7vjjZ5YHs5Iwjmrw1/1DjR5RSlqdQU1ocpukAZ1I0JLAGnkdOnumA=

    等待直至收到完整的响应:

    {"@odata.context":"https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Exports/$entity","Id":8661,"Name":"jobs-02c0398c-227b-47f4-aade-2252146d7d8f","Type":"Jobs","Status":"Completed","RequestedAt":"2024-01-15T07:48:34.88Z","ExecutedAt":"2024-01-15T07:48:38.51Z","Size":692}{"@odata.context":"https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#Exports/$entity","Id":8661,"Name":"jobs-02c0398c-227b-47f4-aade-2252146d7d8f","Type":"Jobs","Status":"Completed","RequestedAt":"2024-01-15T07:48:34.88Z","ExecutedAt":"2024-01-15T07:48:38.51Z","Size":692}
  3. 通过调用 GET https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Exports(8661)/UiPath.Server.Configuration.OData.GetDownloadLink 获取下载链接,其中括号之间的文本是在第 1 步中返回的 ID。

    请求正文如下所示:

    GET https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Exports(8661)/UiPath.Server.Configuration.OData.GetDownloadLink HTTP/1.1
    Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
    X-Uipath-Organizationunitid: 770643GET https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/Exports(8661)/UiPath.Server.Configuration.OData.GetDownloadLink HTTP/1.1
    Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
    X-Uipath-Organizationunitid: 770643

    响应包含一个 URI,您可以使用该 URI 检索数据的 CSV 导出内容:

    {"@odata.context":"https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#UiPath.Server.Configuration.OData.BlobFileAccessDto","Uri":"<Download URI>","Verb":"GET","RequiresAuth":false,"Headers":{"Keys":[],"Values":[]}}{"@odata.context":"https://cloud.uipath.com/{organizationName}/{tenantName}/orchestrator_/odata/$metadata#UiPath.Server.Configuration.OData.BlobFileAccessDto","Uri":"<Download URI>","Verb":"GET","RequiresAuth":false,"Headers":{"Keys":[],"Values":[]}}
  4. 向第 3 步返回的 URI 发出 GET 请求。这将触发 CSV 导出文件的下载。有关格式和命名约定的详细信息,请参阅用户指南中的导出报告部分。

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo White
信任与安全
© 2005-2024 UiPath。保留所有权利。