UiPath Documentation
备注:

使用上述参数值来填充 PUT 请求正文。

请求标头

--header 'Authorization: Bearer {access_token}'\)\)
--header 'Content-Type: application/json' \)\)
--header 'X-UIPATH-OrganizationUnitId: {the_ID_of_the_folder_that_contains_the_queue_item}' \)
--header 'Authorization: Bearer {access_token}'\)\)
--header 'Content-Type: application/json' \)\)
--header 'X-UIPATH-OrganizationUnitId: {the_ID_of_the_folder_that_contains_the_queue_item}' \)

路径参数

参数数据类型描述
Id (必填)字符串要从中删除特定内容的队列项目的 ID。

请求正文

请求正文包含要更新的队列项目信息,例如名称、优先级或引用。

备注:

对于此用例,您只需要更新 'SpecificContent` 键的值。

{
      "Name": "{queue_name}", // String, the_name_of_the_container_queue
      "Priority": "{the_Priority_from_the_GET_response}",//String
    "SpecificContent": {}, // or NULL
      "DeferDate": "{the_DeferDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "DueDate": "{the_DueDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "RiskSlaDate": "{the_RiskSlaDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "Reference": "{the_Reference_from_the_GET_response}", // String
      "Progress": "{the_Progress_from_the_GET_response}" // String
}
{
      "Name": "{queue_name}", // String, the_name_of_the_container_queue
      "Priority": "{the_Priority_from_the_GET_response}",//String
    "SpecificContent": {}, // or NULL
      "DeferDate": "{the_DeferDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "DueDate": "{the_DueDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "RiskSlaDate": "{the_RiskSlaDate_from_the_GET_response}", // 2022-02-17T13:27:43.895Z
      "Reference": "{the_Reference_from_the_GET_response}", // String
      "Progress": "{the_Progress_from_the_GET_response}" // String
}

请求示例

假设您收集了构建 API 调用所需的所有信息。

获取队列项目 OrganizationUnitIdId

要查找文件夹和队列项目 ID,请向 /odata/QueueItems 端点发出 GET 请求:

curl --location --request GET '{OrchestratorURL}/odata/QueueItems' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
curl --location --request GET '{OrchestratorURL}/odata/QueueItems' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \

您可能会收到的响应示例:

{
  "value": [
    {
      "QueueDefinitionId": 29200,
      "OutputData": "{\"DynamicProperties\":{\"Prop1\":\"run\"}}",
      "AnalyticsData": null,
      "Status": "New",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "bc4e8fac-dc4b-4f77-8f20-13590e19ff26",
      "Reference": null,
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": null,
      "Priority": "Normal",
      "DeferDate": null,
      "StartProcessing": "2022-02-16T15:30:12.13Z",
      "EndProcessing": "2022-02-16T15:30:12.46Z",
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"Prop2\":\"accelerate\"}}",
      "CreationTime": "2022-02-16T15:30:11.753Z",
      "Progress": null,
      "RowVersion": "AAAAAAB2liA=",
      "OrganizationUnitId": 62516,
      "OrganizationUnitFullyQualifiedName": "Banana",
      "Id": 3255808,
      "ProcessingException": null,
      "SpecificContent": {
        "Prop2": "Test demo"
      },
      "Output": {
        "Prop1": "vgdfdf"
      },
      "Analytics": null
    },
// other queue items data
    {
      "QueueDefinitionId": 3899,
      "OutputData": null,
      "AnalyticsData": null,
      "Status": "Successful",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "6ea50a9c-b657-4df3-bfe6-d1893c4f31ec",
      "Reference": "82086",
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Priority": "High",
      "DeferDate": null,
      "StartProcessing": null,
      "EndProcessing": null,
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"EmployeeName\":\"John Kensington\",\"ContactNumber\":\"+4457899\",\"RelocationDistance\":500,\"Description\":\"Home relocation\",\"ExpenseCode\":\"UI234\",\"Amount\":1000,\"RequirePass\":true}}",
      "CreationTime": "2021-03-19T17:37:35.893Z",
      "Progress": null,
      "RowVersion": "AAAAAABQET4=",
      "OrganizationUnitId": 39419,
      "OrganizationUnitFullyQualifiedName": "Shared",
      "Id": 2499339,
      "ProcessingException": null,
      "SpecificContent": {
        "EmployeeName": "John Kensington",
        "ContactNumber": "+4457899",
        "RelocationDistance": 500,
        "Description": "Home relocation",
        "ExpenseCode": "UI234",
        "Amount": 1000,
        "RequirePass": true
      },
      "Output": null,
      "Analytics": null
    }
  ]
}
{
  "value": [
    {
      "QueueDefinitionId": 29200,
      "OutputData": "{\"DynamicProperties\":{\"Prop1\":\"run\"}}",
      "AnalyticsData": null,
      "Status": "New",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "bc4e8fac-dc4b-4f77-8f20-13590e19ff26",
      "Reference": null,
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": null,
      "Priority": "Normal",
      "DeferDate": null,
      "StartProcessing": "2022-02-16T15:30:12.13Z",
      "EndProcessing": "2022-02-16T15:30:12.46Z",
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"Prop2\":\"accelerate\"}}",
      "CreationTime": "2022-02-16T15:30:11.753Z",
      "Progress": null,
      "RowVersion": "AAAAAAB2liA=",
      "OrganizationUnitId": 62516,
      "OrganizationUnitFullyQualifiedName": "Banana",
      "Id": 3255808,
      "ProcessingException": null,
      "SpecificContent": {
        "Prop2": "Test demo"
      },
      "Output": {
        "Prop1": "vgdfdf"
      },
      "Analytics": null
    },
// other queue items data
    {
      "QueueDefinitionId": 3899,
      "OutputData": null,
      "AnalyticsData": null,
      "Status": "Successful",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "6ea50a9c-b657-4df3-bfe6-d1893c4f31ec",
      "Reference": "82086",
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Priority": "High",
      "DeferDate": null,
      "StartProcessing": null,
      "EndProcessing": null,
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"EmployeeName\":\"John Kensington\",\"ContactNumber\":\"+4457899\",\"RelocationDistance\":500,\"Description\":\"Home relocation\",\"ExpenseCode\":\"UI234\",\"Amount\":1000,\"RequirePass\":true}}",
      "CreationTime": "2021-03-19T17:37:35.893Z",
      "Progress": null,
      "RowVersion": "AAAAAABQET4=",
      "OrganizationUnitId": 39419,
      "OrganizationUnitFullyQualifiedName": "Shared",
      "Id": 2499339,
      "ProcessingException": null,
      "SpecificContent": {
        "EmployeeName": "John Kensington",
        "ContactNumber": "+4457899",
        "RelocationDistance": 500,
        "Description": "Home relocation",
        "ExpenseCode": "UI234",
        "Amount": 1000,
        "RequirePass": true
      },
      "Output": null,
      "Analytics": null
    }
  ]
}

识别成功的队列项目,并复制以下值:

获取所需的队列项目数据

/odata/QueueItems({Id}) 端点发出 GET 请求:

您可能会收到的响应示例:

{
  "QueueDefinitionId": 3899,
  "OutputData": null,
  "AnalyticsData": null,
  "Status": "Successful",
  "ReviewStatus": "None",
  "ReviewerUserId": null,
  "Key": "6ea50a9c-b657-4df3-bfe6-d1893c4f31ec",
  "Reference": "82086",
  "ProcessingExceptionType": null,
  "DueDate": null,
  "RiskSlaDate": "2022-02-17T13:27:43.895Z",
  "Priority": "High",
  "DeferDate": null,
  "StartProcessing": null,
  "EndProcessing": null,
  "SecondsInPreviousAttempts": 0,
  "AncestorId": null,
  "RetryNumber": 0,
  "SpecificData": "{\"DynamicProperties\":{\"EmployeeName\":\"John Kensington\",\"ContactNumber\":\"+4457899\",\"RelocationDistance\":500,\"Description\":\"Home relocation\",\"ExpenseCode\":\"UI234\",\"Amount\":1000,\"RequirePass\":true}}",
  "CreationTime": "2021-03-19T17:37:35.893Z",
  "Progress": null,
  "RowVersion": "AAAAAABQET4=",
  "OrganizationUnitId": 39419,
  "OrganizationUnitFullyQualifiedName": null,
  "Id": 2499339,
  "ProcessingException": null,
  "SpecificContent": {
    "EmployeeName": "John Kensington",
    "ContactNumber": "+4457899",
    "RelocationDistance": 500,
    "Description": "Home relocation",
    "ExpenseCode": "UI234",
    "Amount": 1000,
    "RequirePass": true
  },
  "Output": null,
  "Analytics": null
}
{
  "QueueDefinitionId": 3899,
  "OutputData": null,
  "AnalyticsData": null,
  "Status": "Successful",
  "ReviewStatus": "None",
  "ReviewerUserId": null,
  "Key": "6ea50a9c-b657-4df3-bfe6-d1893c4f31ec",
  "Reference": "82086",
  "ProcessingExceptionType": null,
  "DueDate": null,
  "RiskSlaDate": "2022-02-17T13:27:43.895Z",
  "Priority": "High",
  "DeferDate": null,
  "StartProcessing": null,
  "EndProcessing": null,
  "SecondsInPreviousAttempts": 0,
  "AncestorId": null,
  "RetryNumber": 0,
  "SpecificData": "{\"DynamicProperties\":{\"EmployeeName\":\"John Kensington\",\"ContactNumber\":\"+4457899\",\"RelocationDistance\":500,\"Description\":\"Home relocation\",\"ExpenseCode\":\"UI234\",\"Amount\":1000,\"RequirePass\":true}}",
  "CreationTime": "2021-03-19T17:37:35.893Z",
  "Progress": null,
  "RowVersion": "AAAAAABQET4=",
  "OrganizationUnitId": 39419,
  "OrganizationUnitFullyQualifiedName": null,
  "Id": 2499339,
  "ProcessingException": null,
  "SpecificContent": {
    "EmployeeName": "John Kensington",
    "ContactNumber": "+4457899",
    "RelocationDistance": 500,
    "Description": "Home relocation",
    "ExpenseCode": "UI234",
    "Amount": 1000,
    "RequirePass": true
  },
  "Output": null,
  "Analytics": null
}

复制以下值:

删除 SpecificContent

发出 PUT 请求,如下所示:

curl --location --request PUT '{OrchestratorURL}/odata/QueueItems(2499339)' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--header 'X-UIPATH-OrganizationUnitId: 39419'\
--data-raw '{
      "Name": "    Queue Demo", 
      "Priority": "High", 
    "SpecificContent": {},
      "DeferDate": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Reference": "82086",
      "Progress": null
}'
curl --location --request PUT '{OrchestratorURL}/odata/QueueItems(2499339)' \
--header 'Authorization: Bearer 1234' \
--header 'Content-Type: application/json' \
--header 'X-UIPATH-OrganizationUnitId: 39419'\
--data-raw '{
      "Name": "    Queue Demo", 
      "Priority": "High", 
    "SpecificContent": {},
      "DeferDate": null,
      "DueDate": null,
      "RiskSlaDate": "2022-02-17T13:27:43.895Z",
      "Reference": "82086",
      "Progress": null
}'
备注:

请注意,SpecificContent 参数是唯一会发生变化的参数(值为 NULL 或空值),其余值则与 GET 响应中的值一致。

在 Orchestrator 用户界面中,此更改显示在相应事务 ID 的“事务”详细信息中。

图 1. 事务详情

导出队列项目

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

备注:

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

  1. 通过调用 POST https://{yourDomain}//odata/QueueDefinitions 来启动导出。根据需要添加筛选器。

请求正文如下所示:

POST https://{yourDomain}/odata/QueueDefinitions(27965)/UiPathODataSvc.Export?$filter=((QueueDefinitionId%20eq%2027965))&$expand=Robot,ReviewerUser HTTP/1.1

Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
X-Uipath-Organizationunitid: 770643
Content-Length: 0
POST https://{yourDomain}/odata/QueueDefinitions(27965)/UiPathODataSvc.Export?$filter=((QueueDefinitionId%20eq%2027965))&$expand=Robot,ReviewerUser HTTP/1.1

Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
X-Uipath-Organizationunitid: 770643
Content-Length: 0

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

{"@odata.context":"https://{yourDomain}/odata/$metadata#Exports/$entity","Id":8657,"Name":"MyQueue12345-items","Type":"Queues","Status":"New","RequestedAt":"2024-01-15T07:38:21.8891311Z","ExecutedAt":null,"Size":null}
{"@odata.context":"https://{yourDomain}/odata/$metadata#Exports/$entity","Id":8657,"Name":"MyQueue12345-items","Type":"Queues","Status":"New","RequestedAt":"2024-01-15T07:38:21.8891311Z","ExecutedAt":null,"Size":null}
  1. 通过调用 GET https://{yourDomain}/orchestrator_/odata/Exports(8657) 来获取请求状态,其中括号之间的文本是在第 1 步中返回的 ID。

请求正文如下所示:

GET https://{yourDomain}/odata/Exports(8657) HTTP/1.1
Host: alpha.uipath.com
Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
X-Uipath-Organizationunitid: 770643
Cookie: __cf_bm=SGYN6zxyBJpmMFjIxBCC8M2eZUvxXaEFqCiZtbidn00-1705304301-1-AUAOuQBjBD1bJQZXFHnyqzGZuBIyHkMpmedMwLZLMtRuGgsyCAsyTOaM8qVoi1meJ0/lRNX6BUZUfV7fWYZc43E=
GET https://{yourDomain}/odata/Exports(8657) HTTP/1.1
Host: alpha.uipath.com
Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
X-Uipath-Organizationunitid: 770643
Cookie: __cf_bm=SGYN6zxyBJpmMFjIxBCC8M2eZUvxXaEFqCiZtbidn00-1705304301-1-AUAOuQBjBD1bJQZXFHnyqzGZuBIyHkMpmedMwLZLMtRuGgsyCAsyTOaM8qVoi1meJ0/lRNX6BUZUfV7fWYZc43E=

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

{"@odata.context":"https://{yourDomain}/odata/$metadata#Exports/$entity","Id":8657,"Name":"MyQueue12345-items","Type":"Queues","Status":"Completed","RequestedAt":"2024-01-15T07:37:02.783Z","ExecutedAt":"2024-01-15T07:37:05.553Z","Size":203226}
{"@odata.context":"https://{yourDomain}/odata/$metadata#Exports/$entity","Id":8657,"Name":"MyQueue12345-items","Type":"Queues","Status":"Completed","RequestedAt":"2024-01-15T07:37:02.783Z","ExecutedAt":"2024-01-15T07:37:05.553Z","Size":203226}
  1. 通过调用 GET https://{yourDomain}/odata/Exports(8657)/UiPath.Server.Configuration.OData.GetDownloadLink 获取下载链接,其中括号之间的文本是在第 1 步中返回的 ID。

请求正文如下所示:

GET https://{yourDomain}/odata/Exports(8657)/UiPath.Server.Configuration.OData.GetDownloadLink HTTP/1.1
Host: alpha.uipath.com
Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
X-Uipath-Organizationunitid: 770643
Cookie: __cf_bm=SGYN6zxyBJpmMFjIxBCC8M2eZUvxXaEFqCiZtbidn00-1705304301-1-AUAOuQBjBD1bJQZXFHnyqzGZuBIyHkMpmedMwLZLMtRuGgsyCAsyTOaM8qVoi1meJ0/lRNX6BUZUfV7fWYZc43E=
GET https://{yourDomain}/odata/Exports(8657)/UiPath.Server.Configuration.OData.GetDownloadLink HTTP/1.1
Host: alpha.uipath.com
Authorization: Bearer rt_45D8A3C5FF2AC56A92A906EE14FB0B8B004D76BAC67AE375521C373F23447684-1
X-Uipath-Organizationunitid: 770643
Cookie: __cf_bm=SGYN6zxyBJpmMFjIxBCC8M2eZUvxXaEFqCiZtbidn00-1705304301-1-AUAOuQBjBD1bJQZXFHnyqzGZuBIyHkMpmedMwLZLMtRuGgsyCAsyTOaM8qVoi1meJ0/lRNX6BUZUfV7fWYZc43E=

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

{"@odata.context":"https://{yourDomain}/odata/$metadata#UiPath.Server.Configuration.OData.BlobFileAccessDto","Uri":"<Download URI>","Verb":"GET","RequiresAuth":false,"Headers":{"Keys":[],"Values":[]}}
{"@odata.context":"https://{yourDomain}/odata/$metadata#UiPath.Server.Configuration.OData.BlobFileAccessDto","Uri":"<Download URI>","Verb":"GET","RequiresAuth":false,"Headers":{"Keys":[],"Values":[]}}
  1. 向第 3 步返回的 URI 发出 GET 请求。这将触发 CSV 导出文件的下载。有关格式和命名约定的详细信息,请参阅用户指南中的导出报告部分。
  • 从队列项目中删除特定内容值
  • API 端点
  • 请求标头
  • 路径参数
  • 请求正文
  • 请求示例
  • 导出队列项目

此页面有帮助吗?