Deserialize http request for queueitems

Hello! I am trying to get every queue item mostly to use for writing reports.

Get queue items can only return 100 at a time and I could just stagger enough calls to that to get all the items in the queue but that is silly and slow.

So now what I am trying to do is get the Jain for the whole queue with HTTP request activity, this part works.

I am then trying to deserialize the Json I get as odataresponselistqueueitemdto. This does create an instance of that type, but context and value are null.

First thing, if a way exists to get an arbitrary number of queue items, that is fine please tell me how.

Second thing, in case this really is the way to do what I am trying to do, why are the members of this object null?

Taken from:
https://docs.uipath.com/orchestrator/reference/api-references

Aquick way for exploring the api is to work with swagger (or postman). Had you tried so far?

The api works, I need to deserialize the resulting jaon

Hey @george.denno!! How are you doing, bro?? Which activity are you using to get the HTTP response? Send us the properties as well.

Thank you!

when api in swagger works, then we would expect also a result by HTTP request activity
we assume you are handling properly the authentications as well

if returned JSON is null/empty/without the expected result, then find out the difference.
Else deserialize the JSON and access with the help of the Newtonsoft API

I am getting the JSON with an http request activity. I have the json, it is fine, and I got it from an http request and it has content.

I need to deserialize the json

  • First of all, check the properties.


    The json result of the request is stored by the “Result” field of type String.

  • Make a print of this String to ensure that it is coming with content, it is also worth checking the “Status Code” of return.

  • In “Deserialize JSON” you need to pass this result String and store it in a variable of type “Newtonsoft.Json.Linq.JObject”

  • From this point you can extract the values ​​correctly.

Hope it helps!

Get json:

Use Orchestrator HTTP Request activity => method = GET; relativeEndpoint = /odata/QueueItems?$expanded=Robot$filter=(QueueName eq ‘UCC_QUEUE)

Deserialize json into ODataResponseListQueueItemDto:

JsonSerializer.Deserialize(of ODataResponseListQueueItemDto)(json)

Resulting object has null context and value.

I think ODataResponseListQueueItem is the right type because deserialization would throw an exception otherwise.

I know the json itself is not null and is well formatted as deserialization would throw an exception otherwise

I am for sure interested to know what is going wrong with this in particular, but again the end state is just to get absolutely every queue item in memory all at the same time as objects (preferably queueItems), and again the problem is that GetQueueItems can only return 100. I also know I could get more than 100 by staggering get queue items calls but that is 1-infinity calls across network and I think if this worked it would be guaranteed one single call across network.