Orchestrator API - Start Transaction

Hello! I have a question regarding the Orchestrator API. In particular, the endpoint /odata/Queue/UiPathODataSvc.AddQueueItem. The endpoint requires a body in which the most importan field is the RobotIdentifier. If I pass a correct one, as well, I obtain to different responses depending on whether my SpecificContent attribute is empty or not.

  1. Specific Content not empty - I obtain a 200, receive data back and the item with that specific content changes status to In Progress.
  2. Specific Content null - I obtain a 204 but nothing seems to change in the queue. The documentation says that passing a null specific content should take the next available item in the queue and moved to In Progress.
  3. Specific Content empty json - Same 204 as before.

I wonder if anyone has had the same issue, or if I’m missing something obvious. Thank you very much for your help.

Hey @Alvaro_Jimenez

What’s your business case please ?

You want to add queue item through API ?

The main parameter what I believe is the Name, Priority.

Thanks
#nK

Hey @Nithinkrishna

I have managed to add queue items through the API. These appear as New, and I want to be able to change the status to In Progress. To do that, I need to use the endpoint I mentioned in the post. However, the documentarion says that if a null SpecificContent field is sent, then it takes the next available item in the queue and that’s what gets returned. But I can’t seem to make it work. The only successful calls to /odata/Queue/UiPathODataSvc.AddQueueItem are when passing something as SpecificContent, but in this case it creates a new item altogether, which I don’t want.

Thanks

Hey @Alvaro_Jimenez

So you are saying you have a queue item with no specific content & you want to change the item status to in-progress once that is added ?

Is that correct ?

Thanks
#nK

Hi @Nithinkrishna , sort of. I have a queue item with specific content and want to change its status, but I can’t do that unless I specify the field “SpecificContent” in the body request to the StartTransaction endpoint. However doing that creates and entirely new item with that SpecificContent, instead of looking in the queue and get the next available one.

Attached there is a screenshot of the Swagger documentation for clarification


o

Can you please elaborate on why you are trying to set an Queue Item/Transaction to “In Progress” via API? This would normally be handled under the scope of the Robot that is fetching the Queue Item to work on. (Whether it is Creating and immediately setting it to “In Progress”, or fetching the next valid queue item to process).

Otherwise if you were to adjust the Status then you would create a disassociation between the queue item and any robot that may work the queue item.

@codemonkee I know this would usually be handled by the Get Transaction activity from UiPath. What I am trying to do is understand how that activity works in the background, and check whether it was possible do the same via API.

Hey @Alvaro_Jimenez

The docs is saying the below…

This means that an existing item with details matched will be updated to in-Progress or a new item will be added & changed to in-Progress

Thanks
#nK

Hi @Nithinkrishna

I know, I do have the right name however the API does not behave as the docs say. If I do not provide a specific content, it does nothing. It doesn’t look for the next item whatsoever

1 Like

Hey @Alvaro_Jimenez

Let me check this once for you

Thanks
#nK