Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This seems to be a very common question with very little successful responses.
I am attempting to pull ticket data from our OneDesk Environment so that I can build a dashboard. I am able to successfully connect using a GET REST connection to pull the information for a specific ticket ID, but I am unable to pull a list of IDs using the POST / filter method proposed by OneDesk. The POST call works just fine in Postman, but of course, I am met with a "Bad Request" error when attempting in Qlik SaaS.
Please view below screenshots to view the FAILED attempt to pull the list of all IDs. I have included the SUCCESSFUL attempt in Postman as the first image.
The syntax for the body was derived from a community article I found marked as an answer to a similar query:
https://community.qlik.com/t5/App-Development/REST-connection-x-www-form-urlencoded/td-p/2085774
It states that you can:
format the request as PowerShell - RestMethod in Postman and then simply Copy Paste the $body content in Qlik.
Please let me know if there is any additional information I can provide.
Here is an example of one of mine:
When entering JSON directly into the request body section of the connection, I only need to use regular double quotes.
When I do it in the script (where I replace the body using with connection), I need to use 2 double quoted together:
let vBody = '{
""name"": ""bob"",
""job"": ""leader""
}';
I don't have access to OneDesk, but looking at the documentation on their site, the error you get isn't documented. I am wondering if their are logs you can look at from the OneDesk side that might show you what it received? If not, can their support tell you what was received?
The body should be valid JSON. You only post the body contents, not the whole line (i.e. the highlighted part):
I'm not saying that's the final solution, but you don't want the parts outside of {}. I use two double quotes (i.e. "" ) rather than a backtick before the double quote (i.e. `" ), but not sure if that matters.
Appreciate the response! Unfortunately the connection is still failing even with the adjustments:
I've tried removing rows, putting it all on one line, without quotes, with quotes.... I am not sure what else to try at this point.
The frustrating thing is that this works in Postman without issues. Why on earth would it be so easily accomplished in Postman but not in Qlik. With the amount of inquiries / submitted issues regarding POST not working in Qlik I am beginning to lose hope.
Here is an example of one of mine:
When entering JSON directly into the request body section of the connection, I only need to use regular double quotes.
When I do it in the script (where I replace the body using with connection), I need to use 2 double quoted together:
let vBody = '{
""name"": ""bob"",
""job"": ""leader""
}';
I don't have access to OneDesk, but looking at the documentation on their site, the error you get isn't documented. I am wondering if their are logs you can look at from the OneDesk side that might show you what it received? If not, can their support tell you what was received?
Thank you again for responding! Your explanation of the JSON syntax within the connection has solved the issue. As expected, it was a simple syntax error preventing the requesting from succeeding. Here is the body that finally worked:
Thank you again.