orchestrator
2023.10
false
UiPath logo, featuring letters U and I in white

Orchestrator API 指南

Automation CloudAutomation Cloud Public SectorAutomation SuiteStandalone
上次更新日期 2024年12月4日

事务请求

注意: 队列项目只能由机器人处理。 例如,向 /odata/Queues/UiPathODataSvc.StartTransaction 端点发出 POST 请求需要仅对机器人可用的信息。

查看项目的历史记录

通过以下调用,您可以查看特定队列项目执行的所有操作。

获取

https://{yourDomain}/odata/QueueItemEvents/UiPath.Server.Configuration.OData.GetQueueItemEventsHistory(queueItemId=1050203)?$orderby=Timestamp&$top=10

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#QueueItemEvents",
    "@odata.count": 5,
    "value": [
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-07T16:02:59.09Z",
            "Action": "Create",
            "Data": null,
            "UserId": 910,
            "UserName": "DocBot",
            "Status": "New",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "ReviewerUserName": null,
            "Id": 18276
        },
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-07T18:15:04.46Z",
            "Action": "Status",
            "Data": null,
            "UserId": 910,
            "UserName": "DocBot",
            "Status": "InProgress",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "ReviewerUserName": null,
            "Id": 20333
        },
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-07T18:15:05.07Z",
            "Action": "Edit",
            "Data": null,
            "UserId": 910,
            "UserName": "DocBot",
            "Status": "InProgress",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "ReviewerUserName": null,
            "Id": 20334
        },
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-07T18:15:05.507Z",
            "Action": "Edit",
            "Data": null,
            "UserId": 910,
            "UserName": "DocBot",
            "Status": "Failed",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "ReviewerUserName": null,
            "Id": 20335
        },
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-08T10:47:40.463Z",
            "Action": "Edit",
            "Data": null,
            "UserId": 583,
            "UserName": "admin",
            "Status": "Failed",
            "ReviewStatus": "None",
            "ReviewerUserId": 583,
            "ReviewerUserName": "admin",
            "Id": 21240
        }
    ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#QueueItemEvents",
    "@odata.count": 5,
    "value": [
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-07T16:02:59.09Z",
            "Action": "Create",
            "Data": null,
            "UserId": 910,
            "UserName": "DocBot",
            "Status": "New",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "ReviewerUserName": null,
            "Id": 18276
        },
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-07T18:15:04.46Z",
            "Action": "Status",
            "Data": null,
            "UserId": 910,
            "UserName": "DocBot",
            "Status": "InProgress",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "ReviewerUserName": null,
            "Id": 20333
        },
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-07T18:15:05.07Z",
            "Action": "Edit",
            "Data": null,
            "UserId": 910,
            "UserName": "DocBot",
            "Status": "InProgress",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "ReviewerUserName": null,
            "Id": 20334
        },
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-07T18:15:05.507Z",
            "Action": "Edit",
            "Data": null,
            "UserId": 910,
            "UserName": "DocBot",
            "Status": "Failed",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "ReviewerUserName": null,
            "Id": 20335
        },
        {
            "QueueItemId": 1050203,
            "Timestamp": "2018-03-08T10:47:40.463Z",
            "Action": "Edit",
            "Data": null,
            "UserId": 583,
            "UserName": "admin",
            "Status": "Failed",
            "ReviewStatus": "None",
            "ReviewerUserId": 583,
            "ReviewerUserName": "admin",
            "Id": 21240
        }
    ]
}

检索特定队列的平均执行时间

通过以下请求,您可以查看指定队列中项目的平均执行时间。

注意: 此类请求只能根据队列名称或说明进行筛选,而不能根据队列 ID 进行筛选。

获取

https://{yourDomain}/odata/QueueProcessingRecords/UiPathODataSvc.RetrieveQueuesProcessingStatus?$filter=QueueDefinitionName eq 'DocQueue'

响应代码

200 OK

响应正文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Collection(UiPath.Core.Model.Queues.QueueProcessingStatus)",
    "@odata.count": 1,
    "value": [
        {
            "ItemsToProcess": 682,
            "ItemsInProgress": 0,
            "QueueDefinitionId": 188,
            "QueueDefinitionName": "DocQueue",
            "QueueDefinitionDescription": null,
            "QueueDefinitionAcceptAutomaticallyRetry": true,
            "QueueDefinitionMaxNumberOfRetries": 5,
            "QueueDefinitionEnforceUniqueReference": false,
            "ProcessingMeanTime": 2.15,
            "SuccessfulTransactionsNo": 0,
            "ApplicationExceptionsNo": 0,
            "BusinessExceptionsNo": 883,
            "SuccessfulTransactionsProcessingTime": 0,
            "ApplicationExceptionsProcessingTime": 0,
            "BusinessExceptionsProcessingTime": 2.15,
            "TotalNumberOfTransactions": 883,
            "LastProcessed": "2018-03-07T18:20:29.3833333Z"
        }
    ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#Collection(UiPath.Core.Model.Queues.QueueProcessingStatus)",
    "@odata.count": 1,
    "value": [
        {
            "ItemsToProcess": 682,
            "ItemsInProgress": 0,
            "QueueDefinitionId": 188,
            "QueueDefinitionName": "DocQueue",
            "QueueDefinitionDescription": null,
            "QueueDefinitionAcceptAutomaticallyRetry": true,
            "QueueDefinitionMaxNumberOfRetries": 5,
            "QueueDefinitionEnforceUniqueReference": false,
            "ProcessingMeanTime": 2.15,
            "SuccessfulTransactionsNo": 0,
            "ApplicationExceptionsNo": 0,
            "BusinessExceptionsNo": 883,
            "SuccessfulTransactionsProcessingTime": 0,
            "ApplicationExceptionsProcessingTime": 0,
            "BusinessExceptionsProcessingTime": 2.15,
            "TotalNumberOfTransactions": 883,
            "LastProcessed": "2018-03-07T18:20:29.3833333Z"
        }
    ]
}

更改队列项目的审核人

以下示例使您能够更改 ID 为 1050200 的失败事务项目的审核人。

注意: 每次更新队列项目时, RowVersion 参数的值都会更改。 要检索此信息,请对 /odata/QueueItems() 端点执行 GET 调用,例如 https://{yourDomain}/odata/QueueItems(1050200)

发布

https://{yourDomain}/odata/QueueItems/UiPathODataSvc.SetItemReviewer

请求标头

密钥

授权

承载

请求正文

{
    "queueItems": [{
        "Id": 1050200, 
        "RowVersion":"AAAAAABDIK8="
    }], 
    "userId": 583
}{
    "queueItems": [{
        "Id": 1050200, 
        "RowVersion":"AAAAAABDIK8="
    }], 
    "userId": 583
}

响应代码

200 OK

响应正文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#UiPath.Application.Dto.BulkOperationResponseDto_1OfInt64",
    "Success": true,
    "Message": null,
    "FailedItems": []
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#UiPath.Application.Dto.BulkOperationResponseDto_1OfInt64",
    "Success": true,
    "Message": null,
    "FailedItems": []
}

检索具有指定审核状态的队列项目

本示例使您能够提取“修订”状态设置为“正在审核”的前两个队列项目。

获取

https://{yourDomain}/odata/QueueItems?$filter=ReviewStatus eq 'InReview'&$top=2

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#QueueItems",
    "@odata.count": 3,
    "value": [
        {
            "QueueDefinitionId": 188,
            "OutputData": null,
            "Status": "Failed",
            "ReviewStatus": "InReview",
            "ReviewerUserId": 583,
            "Key": "e4760d27-a76d-4469-b7e6-fbda2f732b10",
            "Reference": "ActivityDescription",
            "ProcessingExceptionType": "BusinessException",
            "DueDate": null,
            "Priority": "High",
            "DeferDate": null,
            "StartProcessing": "2018-03-07T18:14:56.633Z",
            "EndProcessing": "2018-03-07T18:14:58.723Z",
            "SecondsInPreviousAttempts": 2,
            "AncestorId": null,
            "RetryNumber": 0,
            "SpecificData": "{\"DynamicProperties\":{\"Description\":\"Gets a specified credential by using a provided AssetName, and returns a username and a secure password.\"}}",
            "CreationTime": "2018-03-07T16:02:57.547Z",
            "Progress": null,
            "RowVersion": "AAAAAABDFiU=",
            "Id": 1050199,
            "ProcessingException": {
                "Reason": "authentication",
                "Details": null,
                "Type": "BusinessException",
                "AssociatedImageFilePath": null,
                "CreationTime": "2018-03-07T18:14:58.723Z"
            },
            "SpecificContent": {
                "Description": "Gets a specified credential by using a provided AssetName, and returns a username and a secure password."
            },
            "Output": null
        },
        {
            "QueueDefinitionId": 188,
            "OutputData": null,
            "Status": "Failed",
            "ReviewStatus": "InReview",
            "ReviewerUserId": 583,
            "Key": "e90e8067-50fc-407a-9678-eede311f815a",
            "Reference": "ActivityDescription",
            "ProcessingExceptionType": "BusinessException",
            "DueDate": null,
            "Priority": "High",
            "DeferDate": null,
            "StartProcessing": "2018-03-07T18:14:54.85Z",
            "EndProcessing": "2018-03-07T18:14:57.103Z",
            "SecondsInPreviousAttempts": 2,
            "AncestorId": null,
            "RetryNumber": 0,
            "SpecificData": "{\"DynamicProperties\":{\"Description\":\"Gets a specified asset by using a provided AssetName. If the asset is not global, it must be assigned to the local robot in order to be retrieved.\"}}",
            "CreationTime": "2018-03-07T16:02:57.287Z",
            "Progress": null,
            "RowVersion": "AAAAAABDFiY=",
            "Id": 1050198,
            "ProcessingException": {
                "Reason": "authentication",
                "Details": null,
                "Type": "BusinessException",
                "AssociatedImageFilePath": null,
                "CreationTime": "2018-03-07T18:14:57.103Z"
            },
            "SpecificContent": {
                "Description": "Gets a specified asset by using a provided AssetName. If the asset is not global, it must be assigned to the local robot in order to be retrieved."
            },
            "Output": null
        }
    ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#QueueItems",
    "@odata.count": 3,
    "value": [
        {
            "QueueDefinitionId": 188,
            "OutputData": null,
            "Status": "Failed",
            "ReviewStatus": "InReview",
            "ReviewerUserId": 583,
            "Key": "e4760d27-a76d-4469-b7e6-fbda2f732b10",
            "Reference": "ActivityDescription",
            "ProcessingExceptionType": "BusinessException",
            "DueDate": null,
            "Priority": "High",
            "DeferDate": null,
            "StartProcessing": "2018-03-07T18:14:56.633Z",
            "EndProcessing": "2018-03-07T18:14:58.723Z",
            "SecondsInPreviousAttempts": 2,
            "AncestorId": null,
            "RetryNumber": 0,
            "SpecificData": "{\"DynamicProperties\":{\"Description\":\"Gets a specified credential by using a provided AssetName, and returns a username and a secure password.\"}}",
            "CreationTime": "2018-03-07T16:02:57.547Z",
            "Progress": null,
            "RowVersion": "AAAAAABDFiU=",
            "Id": 1050199,
            "ProcessingException": {
                "Reason": "authentication",
                "Details": null,
                "Type": "BusinessException",
                "AssociatedImageFilePath": null,
                "CreationTime": "2018-03-07T18:14:58.723Z"
            },
            "SpecificContent": {
                "Description": "Gets a specified credential by using a provided AssetName, and returns a username and a secure password."
            },
            "Output": null
        },
        {
            "QueueDefinitionId": 188,
            "OutputData": null,
            "Status": "Failed",
            "ReviewStatus": "InReview",
            "ReviewerUserId": 583,
            "Key": "e90e8067-50fc-407a-9678-eede311f815a",
            "Reference": "ActivityDescription",
            "ProcessingExceptionType": "BusinessException",
            "DueDate": null,
            "Priority": "High",
            "DeferDate": null,
            "StartProcessing": "2018-03-07T18:14:54.85Z",
            "EndProcessing": "2018-03-07T18:14:57.103Z",
            "SecondsInPreviousAttempts": 2,
            "AncestorId": null,
            "RetryNumber": 0,
            "SpecificData": "{\"DynamicProperties\":{\"Description\":\"Gets a specified asset by using a provided AssetName. If the asset is not global, it must be assigned to the local robot in order to be retrieved.\"}}",
            "CreationTime": "2018-03-07T16:02:57.287Z",
            "Progress": null,
            "RowVersion": "AAAAAABDFiY=",
            "Id": 1050198,
            "ProcessingException": {
                "Reason": "authentication",
                "Details": null,
                "Type": "BusinessException",
                "AssociatedImageFilePath": null,
                "CreationTime": "2018-03-07T18:14:57.103Z"
            },
            "SpecificContent": {
                "Description": "Gets a specified asset by using a provided AssetName. If the asset is not global, it must be assigned to the local robot in order to be retrieved."
            },
            "Output": null
        }
    ]
}

添加队列项目

下面的示例使我们能够将具有高优先级、延迟和截止日期以及两个带值的参数的项目添加到“DocQueue”队列中。 与“ 添加队列项目”活动一样,以此类推方式添加的所有项目都具有“新建”状态。

请注意, SpecificContent 参数应仅使用原始值填充。

发布

https://{yourDomain}/odata/Queues/UiPathODataSvc.AddQueueItem

请求标头

密钥

授权

承载

请求正文

{
    "itemData": {
        "Priority": "High",
        "DeferDate": "2018-03-21T13:42:27.654Z",
        "DueDate": "2018-03-25T13:42:27.654Z",
        "Name": "DocQueue",
        "SpecificContent": {
            "Email": "obrian@uipath.com", 
            "Name": "O'Brian"
        }
    }
}{
    "itemData": {
        "Priority": "High",
        "DeferDate": "2018-03-21T13:42:27.654Z",
        "DueDate": "2018-03-25T13:42:27.654Z",
        "Name": "DocQueue",
        "SpecificContent": {
            "Email": "obrian@uipath.com", 
            "Name": "O'Brian"
        }
    }
}

响应代码

200 OK

响应正文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#queueItem/$entity",
    "QueueDefinitionId": 188,
    "OutputData": null,
    "Status": "New",
    "ReviewStatus": "None",
    "ReviewerUserId": null,
    "Key": "e9cb2205-0232-4b99-9556-52dc2e686663",
    "Reference": null,
    "ProcessingExceptionType": null,
    "DueDate": "2018-03-25T13:42:27.654Z",
    "Priority": "High",
    "DeferDate": "2018-03-21T13:42:27.654Z",
    "StartProcessing": null,
    "EndProcessing": null,
    "SecondsInPreviousAttempts": 0,
    "AncestorId": null,
    "RetryNumber": 0,
    "SpecificData": "{\"DynamicProperties\":{\"Email\":\"obrian@uipath.com\",\"Name\":\"O'brian\"}}",
    "CreationTime": "2018-03-21T15:31:27.2699068Z",
    "Progress": null,
    "RowVersion": "AAAAAABDGLk=",
    "Id": 1050947,
    "ProcessingException": null,
    "SpecificContent": {
        "Email": "obrian@uipath.com",
        "Name": "O'Brian"
    },
    "Output": null
}}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#queueItem/$entity",
    "QueueDefinitionId": 188,
    "OutputData": null,
    "Status": "New",
    "ReviewStatus": "None",
    "ReviewerUserId": null,
    "Key": "e9cb2205-0232-4b99-9556-52dc2e686663",
    "Reference": null,
    "ProcessingExceptionType": null,
    "DueDate": "2018-03-25T13:42:27.654Z",
    "Priority": "High",
    "DeferDate": "2018-03-21T13:42:27.654Z",
    "StartProcessing": null,
    "EndProcessing": null,
    "SecondsInPreviousAttempts": 0,
    "AncestorId": null,
    "RetryNumber": 0,
    "SpecificData": "{\"DynamicProperties\":{\"Email\":\"obrian@uipath.com\",\"Name\":\"O'brian\"}}",
    "CreationTime": "2018-03-21T15:31:27.2699068Z",
    "Progress": null,
    "RowVersion": "AAAAAABDGLk=",
    "Id": 1050947,
    "ProcessingException": null,
    "SpecificContent": {
        "Email": "obrian@uipath.com",
        "Name": "O'Brian"
    },
    "Output": null
}}

添加多个队列项目

重要提示:
如果您被分配到多个文件夹,则您的请求必须包含 HTTP 标头,提供所需队列的 FolderIdFolderPath 。 有关详细信息,请参阅 此处
如果未包含在内,则请求将失败并显示以下错误: An organization unit is required for this action.

下面的示例使我们能够同时将多个项目添加到已配置为仅允许唯一引用的“DocTest”队列中。 添加项目后,它们都将具有“ 新建” 状态。

建议为特定数据内容指定数据类型。 例如,如果“ 名称 ” 字段包含字符串类型的数据,则应使用以下语法 "Name@odata.type": "#string"添加额外的键:值对。 请参阅下面的示例。

第一个示例成功,而后者失败,因为项目缺少唯一引用队列所需的引用。

添加多个队列项目时,可以使用两种上传策略:

  • AllOrNothing - 仅在未遇到错误时添加队列项目。 否则,它不会插入任何内容,并返回发生错误的行。
  • ProcessAllIndependently - 添加所有项目并返回所有失败项目的列表。
    备注:

    失败的请求将返回 200 OK,因为失败的项目将在响应正文中返回,如第二个示例所示。

    唯一不返回 200 OK 的请求是输入参数不正确的请求。

请求成功

发布

https://{yourDomain}/odata/Queues/UiPathODataSvc.BulkAddQueueItems

请求标头

密钥

授权

承载

请求正文

{
    "queueName": "DocTest",
    "commitType": "AllOrNothing",
    "queueItems": [{
            "Priority": "High",
            "SpecificContent": {
                "Name": "rêvé",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
            "Reference": "ref4"
        },
        {
            "Priority": "High",
            "SpecificContent": {
                "Name": "même",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
            "Reference": "ref5"
        },
        {
            "Priority": "High",
            "SpecificContent": {
                "Name": "Žao",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
            "Reference": "ref6"
        }
    ]
}{
    "queueName": "DocTest",
    "commitType": "AllOrNothing",
    "queueItems": [{
            "Priority": "High",
            "SpecificContent": {
                "Name": "rêvé",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
            "Reference": "ref4"
        },
        {
            "Priority": "High",
            "SpecificContent": {
                "Name": "même",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
            "Reference": "ref5"
        },
        {
            "Priority": "High",
            "SpecificContent": {
                "Name": "Žao",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
            "Reference": "ref6"
        }
    ]
}

响应代码

200 OK

响应正文

{
  "@odata.context": "https://{yourDomain}/odata/$metadata#UiPath.Application.Dto.BulkOperationResponseDto_1OfFailedQueueItemDto",
  "Success": true,
  "Message": null,
  "FailedItems": []
}{
  "@odata.context": "https://{yourDomain}/odata/$metadata#UiPath.Application.Dto.BulkOperationResponseDto_1OfFailedQueueItemDto",
  "Success": true,
  "Message": null,
  "FailedItems": []
}

请求失败

发布

https://{yourDomain}/odata/Queues/UiPathODataSvc.BulkAddQueueItems

请求标头

密钥

授权

承载

请求正文

{
    "queueName": "DocTest",
    "commitType": "AllOrNothing",
    "queueItems": [{
            "Priority": "High",
            "SpecificContent": {
                "Name": "rêvé",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
        },
        {
            "Priority": "High",
            "SpecificContent": {
                "Name": "même",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
        },
        {
            "Priority": "High",
            "SpecificContent": {
                "Name": "Žao",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
        }
    ]
}{
    "queueName": "DocTest",
    "commitType": "AllOrNothing",
    "queueItems": [{
            "Priority": "High",
            "SpecificContent": {
                "Name": "rêvé",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
        },
        {
            "Priority": "High",
            "SpecificContent": {
                "Name": "même",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
        },
        {
            "Priority": "High",
            "SpecificContent": {
                "Name": "Žao",
                "Name@odata.type": "#String"
            },
            "DeferDate": "2019-03-14T12:20:13.290Z",
            "DueDate": "2019-03-14T12:20:13.290Z",
        }
    ]
}

响应代码

200 OK

响应正文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#UiPath.Application.Dto.BulkOperationResponseDto_1OfFailedQueueItemDto",
    "Success": false,
    "Message": "Some items have not been inserted.",
    "FailedItems": [{
        "Ordinal": 1,
        "ErrorCode": "TransactionReferenceRequired",
        "ErrorMessage": "Error creating Transaction. Reference is required for Unique Reference Queues."
    }]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#UiPath.Application.Dto.BulkOperationResponseDto_1OfFailedQueueItemDto",
    "Success": false,
    "Message": "Some items have not been inserted.",
    "FailedItems": [{
        "Ordinal": 1,
        "ErrorCode": "TransactionReferenceRequired",
        "ErrorMessage": "Error creating Transaction. Reference is required for Unique Reference Queues."
    }]
}

根据状态和机器人 ID 检索事务

以下示例在 Orchestrator 数据库中查询由 ID 为 749 的机器人处理且状态为“ 正在进行 ”的前 10 个队列项目。 最后,展开机器人信息。 请注意,响应已截断。

获取

https://{yourDomain}/odata/QueueItems?$top=10&$expand=Robot&$filter=Status eq 'InProgress' and Robot/Id eq 749

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#QueueItems",
    "@odata.count": 1752,
    "value": [
        {
            "QueueDefinitionId": 188,
            "OutputData": null,
            "Status": "InProgress",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "Key": "1c632cc1-44ab-4624-bace-6fbb5fd1c0cd",
            "Reference": "ActivityDescription",
            "ProcessingExceptionType": null,
            "DueDate": null,
            "Priority": "High",
            "DeferDate": null,
            "StartProcessing": "2018-03-07T15:05:05.113Z",
            "EndProcessing": null,
            "SecondsInPreviousAttempts": 0,
            "AncestorId": null,
            "RetryNumber": 0,
            "SpecificData": "{\"DynamicProperties\":{\"Description\":\"Checks if Stop was triggered in UiPath Orchestrator.\"}}",
            "CreationTime": "2018-03-05T18:39:16.06Z",
            "Progress": null,
            "RowVersion": "AAAAAABC3aA=",
            "Id": 1048065,
            "ProcessingException": null,
            "SpecificContent": {
                "Description": "Checks if Stop was triggered in UiPath Orchestrator."
            },
            "Output": null,
            "Robot": {
                "LicenseKey": null,
                "MachineName": "MBOBOC",
                "Name": "DocBot",
                "Username": "UIPATH\\MADALINA.BOBOC",
                "Description": null,
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "",
                "Id": 749,
                "ExecutionSettings": null
            }
        },
        {
            "QueueDefinitionId": 188,
            "OutputData": null,
            "Status": "InProgress",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "Key": "7dfa834b-8398-476e-bd18-b0fa51d4ddf6",
            "Reference": "ActivityDescription",
            "ProcessingExceptionType": null,
            "DueDate": null,
            "Priority": "High",
            "DeferDate": null,
            "StartProcessing": "2018-03-07T15:05:04.503Z",
            "EndProcessing": null,
            "SecondsInPreviousAttempts": 0,
            "AncestorId": null,
            "RetryNumber": 0,
            "SpecificData": "{\"DynamicProperties\":{\"Description\":\"Sets the status of a transaction item to Failed or Successful.\"}}",
            "CreationTime": "2018-03-05T18:39:15.627Z",
            "Progress": null,
            "RowVersion": "AAAAAABC3Z8=",
            "Id": 1048064,
            "ProcessingException": null,
            "SpecificContent": {
                "Description": "Sets the status of a transaction item to Failed or Successful."
            },
            "Output": null,
            "Robot": {
                "LicenseKey": null,
                "MachineName": "MBOBOC",
                "Name": "DocBot",
                "Username": "UIPATH\\MADALINA.BOBOC",
                "Description": null,
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "",
                "Id": 749,
                "ExecutionSettings": null
            }
        }
    ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#QueueItems",
    "@odata.count": 1752,
    "value": [
        {
            "QueueDefinitionId": 188,
            "OutputData": null,
            "Status": "InProgress",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "Key": "1c632cc1-44ab-4624-bace-6fbb5fd1c0cd",
            "Reference": "ActivityDescription",
            "ProcessingExceptionType": null,
            "DueDate": null,
            "Priority": "High",
            "DeferDate": null,
            "StartProcessing": "2018-03-07T15:05:05.113Z",
            "EndProcessing": null,
            "SecondsInPreviousAttempts": 0,
            "AncestorId": null,
            "RetryNumber": 0,
            "SpecificData": "{\"DynamicProperties\":{\"Description\":\"Checks if Stop was triggered in UiPath Orchestrator.\"}}",
            "CreationTime": "2018-03-05T18:39:16.06Z",
            "Progress": null,
            "RowVersion": "AAAAAABC3aA=",
            "Id": 1048065,
            "ProcessingException": null,
            "SpecificContent": {
                "Description": "Checks if Stop was triggered in UiPath Orchestrator."
            },
            "Output": null,
            "Robot": {
                "LicenseKey": null,
                "MachineName": "MBOBOC",
                "Name": "DocBot",
                "Username": "UIPATH\\MADALINA.BOBOC",
                "Description": null,
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "",
                "Id": 749,
                "ExecutionSettings": null
            }
        },
        {
            "QueueDefinitionId": 188,
            "OutputData": null,
            "Status": "InProgress",
            "ReviewStatus": "None",
            "ReviewerUserId": null,
            "Key": "7dfa834b-8398-476e-bd18-b0fa51d4ddf6",
            "Reference": "ActivityDescription",
            "ProcessingExceptionType": null,
            "DueDate": null,
            "Priority": "High",
            "DeferDate": null,
            "StartProcessing": "2018-03-07T15:05:04.503Z",
            "EndProcessing": null,
            "SecondsInPreviousAttempts": 0,
            "AncestorId": null,
            "RetryNumber": 0,
            "SpecificData": "{\"DynamicProperties\":{\"Description\":\"Sets the status of a transaction item to Failed or Successful.\"}}",
            "CreationTime": "2018-03-05T18:39:15.627Z",
            "Progress": null,
            "RowVersion": "AAAAAABC3Z8=",
            "Id": 1048064,
            "ProcessingException": null,
            "SpecificContent": {
                "Description": "Sets the status of a transaction item to Failed or Successful."
            },
            "Output": null,
            "Robot": {
                "LicenseKey": null,
                "MachineName": "MBOBOC",
                "Name": "DocBot",
                "Username": "UIPATH\\MADALINA.BOBOC",
                "Description": null,
                "Type": "NonProduction",
                "Password": null,
                "RobotEnvironments": "",
                "Id": 749,
                "ExecutionSettings": null
            }
        }
    ]
}

检索特定项目的注释

以下示例按创建时间升序显示 ID 为 1050204 的队列项目的所有注释。

获取

https://{yourDomain}/odata/QueueItemComments/UiPath.Server.Configuration.OData.GetQueueItemCommentsHistory(queueItemId=1050204)?$orderby=CreationTime%20desc

请求标头

密钥

授权

承载

响应代码

200 OK

响应正文

{
    "@odata.context": "https://{yourDomain}/odata/$metadata#QueueItemComments",
    "@odata.count": 2,
    "value": [
        {
            "Text": "needs review asap",
            "QueueItemId": 1050204,
            "CreationTime": "2018-03-08T13:41:49.167Z",
            "UserId": 583,
            "UserName": "admin",
            "Id": 320
        },
        {
            "Text": "fixed. excel hiccup.",
            "QueueItemId": 1050204,
            "CreationTime": "2018-03-08T13:46:48.613Z",
            "UserId": 901,
            "UserName": "dragomirmir",
            "Id": 321
        }
    ]
}{
    "@odata.context": "https://{yourDomain}/odata/$metadata#QueueItemComments",
    "@odata.count": 2,
    "value": [
        {
            "Text": "needs review asap",
            "QueueItemId": 1050204,
            "CreationTime": "2018-03-08T13:41:49.167Z",
            "UserId": 583,
            "UserName": "admin",
            "Id": 320
        },
        {
            "Text": "fixed. excel hiccup.",
            "QueueItemId": 1050204,
            "CreationTime": "2018-03-08T13:46:48.613Z",
            "UserId": 901,
            "UserName": "dragomirmir",
            "Id": 321
        }
    ]
}

此页面有帮助吗?

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