Download Tool issue with POST json payload and quotes and & chars
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I am trying to use the Download Tool to POST a json payload to a REST endpoint.
The tool works unless there is a double quote or & in the json payload in which case the endpoint returns "Unable to parse the JSON" response. I have tried escaping the double quote but it still does not work.
example of the payload is :
{ "note": { "description": "this is a test with chars & \" present", "show_to_requester": false, "mark_first_response": false, "add_to_linked_requests": false }}
I have used Postman to perform the POST with exactly the same payload and the call works as expected without an error.
If i completely remove the characters then the POST works.
Has anyone else experienced this or found a way to make it work.
thanks in advance
- Labels:
- Download
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @DY1 ,
I have not come across this before. Just a quick check, how are you building the JSON field? Are you using the JSOB Build tool? This will build it in the correct format. If so, and the format is still creating a problem, is it a problem to simply remove the characters from the field being posted before it gets to the download tool?
M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is this the same content-type that postman is using? application/x-www-form-urlencoded? - not application/json? - having said that this stuff is pretty specific and extra " or { can throw things.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hey @DY1
Have you tried the 'Take Query String/Body from Field' option instead of 'and values from these fields'?
Is this a publicly available api by any chance?
Cheers,
TheOC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @apathetichell, yes the content type is identical to that used in Postman.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @TheOC , unforunately its not a public API. I have tried quite a number of approaches but none seem to work other than simply removing the characters completely
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @mceleavey , i have manually created the json however i have checked it by passing it thought he Json Parse tool and it parses fine, it appears to be something specific to the Download Tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hey @DY1
I've used the Json build tool to create the string - in theory this should convert it correctly.
Can you please try the attached, as the input to your download tool? You will need to include the URL too.
Hopefully it helps,
TheOC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @TheOC , thanks for taking the time to do this. taken the workflow you created and modified the input so that it just has the double quote rather than the escaped version. the output from the first parse tool is exactly what i am manually creating which still results in an error. the second parse tool escapes all of the quotes in the whole json string which doesnt work.
