Hi Everyone,
In our process, we are building a bot to push queue items using API. The structure of the JSON body:
""{""itemData"": {""Name"": ""Value1"",""Priority"": ""Value2"",""SpecificContent"": {""Data"": [{""Key3"": ""Test"",""Key4"": ""TES8"",""Key5"": ""Test"",""Key6"": ""1234 Street""}] }}}""
The error message logged:
{
“message”: “queueItemParameters must not be null”,
“errorCode”: 0,
“resourceIds”: null
}
Inside the Specific Content, we need to add a key with an array value. Can anyone help me on this one?
Thanks,
2 Likes
Lak_Ui
(Lakshmi)
May 9, 2022, 10:00am
2
1 Like
We are using On-Prem Orchestrator, we can’t able to establish the connection to the orchestrator.
1 Like
Hey @john.mari
I guess you are missing few mandatory parameters like Name and Priority !
Adding Reference may also be useful
Thanks
#nK
No, we added those parameters in the body.
1 Like
Hey @john.mari
Then it should work, could you please show the full request body please.
Thanks
#nK
Hello @john.mari ,
Check the below post. I think it should help.
Having done a further research I can share further information on the problem.
Apparently referring to the orchestrator 2018 API Guide a sample response should be looking somehow like this:
{
“@odata.context”: “https://platform.uipath.com/odata/$metadata#queueItem/$entity ”,
“QueueDefinitionId”: 188,
“OutputData”: null,
“Status”: “New”,
“ReviewStatus”: “None”,
“ReviewerUserId”: null,
“Key”: “e9cb2205-0232-4b99-9556-52dc2e686663”,
“Reference”: null,
“ProcessingExceptionType”: null,
“D…
The queue data need to add like the above image.
john.mari
(John Mari)
May 9, 2022, 10:39am
10
We were able to add a queue like the one mentioned in the above thread. But, we can’t able to add a queue item with a “Key”: “Object Value”.
1 Like
Hey @john.mari
What do you mean by key object value ?
Thanks
#nK
Nithin_P
(Nithin Prabhu)
May 9, 2022, 12:36pm
12
Hi @john.mari ,
Here is a sample of what you should send in the Request Body of the Add Queue Item API End Point. This should generate Key Value Pairs under Specific Data.
{
"itemData": {
"Name": "Test",
"Priority": "High",
"SpecificContent": {
"Key1": "ObjectValue1",
"Key2": "ObjectValue2",
"Key3": "ObjectValue3"
},
"DeferDate": "2022-05-10T09:49:37.758Z",
"DueDate": "2022-05-12T09:49:37.758Z",
"RiskSlaDate": "2022-05-11T09:49:37.758Z",
"Reference": "SomeUniqueReference",
"Progress": "New"
}
}
Hope that helps !
Regards,
Nithin
1 Like
The Object is JSON Array. We are passing value as JSON array for the Data key.
1 Like
Hey @john.mari
I guess I tried once but unable to succeed in previous versions.
Thanks
#nK
HarishV
(Harish V)
May 12, 2022, 1:34pm
17
Hi @john.mari ,
Please verify the below mentioned format.
"{""itemData"": {""Name"": ""Value1"",""Priority"": ""Value2"",""SpecificContent"": {""Data"": ""[{\""Key3\"":\""Test\"",\""Key4\"":\""TES8\"",\""Key5\"":\""Test\"",\""Key6\"":\""1234Street\""}]""}}}"
Try this in the “Body” parameter of “HttpRequest” activity.
Thanks
2 Likes
john.mari
(John Mari)
May 12, 2022, 2:16pm
18
I tried it. It works well. Thank you
The reason is that SpecificContent is looking for a Dictionary(Of String, Object) and does not support more complex JSON Object. You are better off leveraging your library of choice to craft your JSON and serializing the parts that require it when needed in order to keep your JSON String building simple.
Please see the following post using JSON.stringify
in Postman to prepare the data
@pikorpa pointed out SpecificContent is Dictionary(Of String, Object), so if you want to add a more complex JSON object that contains Arrays / Objects, you must first serialize the JSON.
{
"itemData": {
"Name": "asdf",
"Priority": "High",
"Reference": "{{$guid}}",
"SpecificContent": {
"Test" : {{specific_content}}
}
}
}
In the above specific_content is the value string of the following (Using Postman)
const TestData= [{
"seq": 1,
"loc": {"addres…
1 Like
system
(system)
Closed
May 15, 2022, 8:54pm
20
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.