Orchestrator API complex types

So I am having no luck using http requests to communicate with my Orchestrator server. I can authenticate successfully, but my request for to add a new queue item (https://orchestrator.uipath.com/v2017.1/reference#queues_addqueueitem-1) returns this error message {“message”:“queueItemParameters is null!”,“errorCode”:0}. I sent the http request with the parameters in a dictionary format, but this documentation (UiPath Orchestrator API Guide 2016.2) shows that they should be complex types and I don’t know how to write that in python. Anyone else have a clue?

Hi @rmccloud,

I haven’t worked with Queues (yet), but have had similar issues trying to understand Assets from the documentation. It’s almost impossible to do, with only the documentation at hand. I’ve been struggling with this for a couple of weeks, loads of trial and error, very annoying.

Then I found that although the documentation lacks usability, the Orchestrator actually has a swagger documentation and test interface, which will let you mess around with the JSON that you can send to the API. Orchestrator CE has this feature, see UiPath. I’m not sure if it’s a 2018 feature, it may exist in older versions as well, just try by adding /swagger to your Orchestrator URL.

If your own Orchestrator has this feature, you can find an API key in Settings / Deployment in your Orchestrator web interface, and enter it into the api_key field in the swagger UI. Then scroll down to the Queues part, and start adjusting the test examples with your own test data to throw towards the API. If your Orchestrator doesn’t have the /swagger feature, just register a tenant on https://platform.uipath.com/, and start testing over there.

Just keep in mind that in the end, it’s just a bunch of JSON that you need send to the API. Python dictionaries translate to JSON objects, Python lists and tuples translate to JSON arrays. Once you get a hang of what JSON to send to the API, it shouldn’t be too much of an effort to understand how to represent the structure in Python dicts and lists (and lists of dicts, lists of lists, dicts with list values, etcetera).

Good luck!

3 Likes

That sounds like a really cool and helpful feature that I had no idea existed. I will check it out first thing when I get to work Monday. Thanks!

@Prutsert, good one buddy! It helped me a lot!!

Hi,

Were you able to do it? I am trying something of this type with SOAP UI.

Without the complex parameter (“complex_parameter”) it works fine but not when I add it.

This works fine:
{
“itemData”: {
“Priority”: “High”,
“Name”: “Test”,
“SpecificContent”: {
“parameter1” : “111”,
“parameter2” : “222”,
“parameter3” : “333”
}
}
}
This does not work:
{
“itemData”: {
“Priority”: “High”,
“Name”: “Test”,
“SpecificContent”: {
“parameter1” : “111”,
“parameter2” : “222”,
“parameter3” : “333”,
"complex_parameter " : {
“complex1” : “complex_value1”,
“complex2” : “complex_value2”
}
}
}
}

Is it possible to do the second one?

2 Likes