Orchestrator
2022.10
False
Imagen de fondo del banner
Guía de la API de Orchestrator
Última actualización 10 de nov. de 2023

Solicitudes de elementos en cola

Importante:
/QueueItems recuento de puntos finales y muestra la propiedad DTO para cada periodicidad de un artículo en cola en todas las carpetas a las que está vinculada la cola. Por ejemplo, si tienes un (1) artículo en cola para una cola que está vinculada a tres (3) carpetas, el número de artículos en cola mostrados y el recuento es tres (1x3).
Para recuperar los resultados de una carpeta específica, utiliza el encabezado X-UiPath-OrganizationUnitId.

Eliminar el valor de SpecificContent de un elemento de la cola

La siguiente solicitud PUT al punto final /odata/QueueItems({key}) te permite eliminar el contenido específico del elemento de cola especificado, identificable por {key}.
Importante: ahora también puedes eliminar el contenido específico de los elementos de la cola con estados Correcto,Eliminadoo Reintentado .

Punto final de API

PONER /odata/QueueItems({Id})

Para eliminar el contenido específico, debes establecer el valor correspondiente como NULL o vacío, mientras que todos los demás valores de la carga útil coincidan con los que están en el estado correcto. Es decir, solo se elimina el contenido, mientras que el resto de parámetros de la solicitud permanecen igual.

Para averiguar cuáles son los valores para los parámetros de la solicitud PUT, realiza una solicitud GET a/odata/QueueItems. La respuesta muestra todos los elementos de la cola de tu tenant.

Identifique el artículo en cola que le interesa y copie los valores de los siguientes parámetros:

  • "OrganizationUnitId" el identificador de la carpeta que contiene el elemento de la cola
  • "Id" el ID del artículo en cola. Asegúrese de seleccionar el elemento de la cola con el estado Correcto .

Realiza una segunda solicitud GET a /odata/QueueItems({Id})y reemplaza {Id} con el ID del artículo en cola que copiaste de la llamada GET anterior. La respuesta muestra los datos del elemento de cola deseado. Copie los valores de los siguientes parámetros:
  • "Nombre" para reemplazar {the_Name_from_the_GET_response} en la solicitud de muestra
  • «Prioridad» para reemplazar {the_Priority_from_the_GET_response} en la solicitud de muestra
  • «DeferDate» para reemplazar {the_DeferDate_from_the_GET_response} en la solicitud de muestra
  • «DueDate» para reemplazar {the_DueDate_from_the_GET_response} en la solicitud de muestra
  • "RiskSlaDate" para reemplazar {the_RiskSlaDate_from_the_GET_response} en la solicitud de muestra
  • «Referencia» para reemplazar {the_Reference_from_the_GET_response} en la solicitud de muestra
  • «Progreso» para reemplazar {the_Progress_from_the_GET_response} en la solicitud de muestra
    Nota: Puedes utilizar los valores de los parámetros anteriores para rellenar el cuerpo de la solicitud PUT.

Solicitar encabezados.

--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}' \

Parámetros de ruta

Parámetros

Tipo de datos

Descripción

Id

(obligatorio)

Cadena

El ID del elemento de la cola del que desea eliminar el contenido específico.

Solicitar cuerpo

El cuerpo de la solicitud contiene la información del elemento de la cola que quieres actualizar, como el nombre, la prioridad o la referencia.

Nota: para este caso práctico, SÓLO necesita actualizar el valor de la clave 'ContenidoEspecificado'.
{
      "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
}

Solicitud de ejemplo

Supongamos que has recopilado toda la información necesaria para crear la llamada a la API.

Obtener elementos de la cola OrganizationUnitId y Id

Para averiguar los ID de carpeta y elemento de cola, realiza una solicitud GET al punto final /odata/QueueItems :
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' \

Una muestra de la respuesta que puede recibir:

{
  "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
    }
  ]
}

Identifique el elemento de la cola Correcto y copie los siguientes valores:

  • "OrganizationUnitId" : 39419
  • "Id": 2499339

Obtener los datos del artículo en cola deseado

Realizar una solicitud GET al punto final /odata/QueueItems({Id}) :
  • Reemplace {Id} con el valor del ID encontrado anteriormente (es decir, 2499339)
  • Use el encabezado de la solicitud X-UIPATH-OrganizationUnitId e introduzca el valor del OrganizationUnitId encontrado anteriormente (es decir, 39419)
    curl --location --request GET '{OrchestratorURL}/odata/QueueItems(2499339)' \
    --header 'Authorization: Bearer 1234' \
    --header 'Content-Type: application/json' \
    --header 'X-UIPATH-OrganizationUnitId: 39419'curl --location --request GET '{OrchestratorURL}/odata/QueueItems(2499339)' \
    --header 'Authorization: Bearer 1234' \
    --header 'Content-Type: application/json' \
    --header 'X-UIPATH-OrganizationUnitId: 39419'

    Una muestra de la respuesta que puede recibir:

    {
      "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
    }

Copie los siguientes valores:

  • "Priority" : "High"
  • "DeferDate" : null
  • «DueDate»: null
  • "RiskSlaDate": "2022-02-17T13:27:43.895Z"
  • "Reference" : "82086"
  • "Progress" : null

Elimina el valor SpecificContent

Realice la solicitud PUT de la siguiente manera:

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
}'
Nota: Observa que el parámetro SpecificContent es el único que cambia, al tener un valor NULL o uno vacío, mientras que el resto de valores coinciden con los valores de la respuesta GET.

En la interfaz de usuario de Orchestrator, el cambio es visible en los Detalles de transacción del ID de transacción correspondiente.



Was this page helpful?

Obtén la ayuda que necesitas
RPA para el aprendizaje - Cursos de automatización
Foro de la comunidad UiPath
Logotipo blanco de UiPath
Confianza y seguridad
© 2005-2024 UiPath. All rights reserved.