Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Download Tool issue with POST json payload and quotes and & chars

DY1
7 - Meteor

Hi,

 

I am trying to use the Download Tool to POST a json payload to a REST endpoint. 

 

DY1_0-1638969611998.png

 

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 

15 REPLIES 15
mceleavey
17 - Castor
17 - Castor

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.



Bulien

apathetichell
18 - Pollux

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.

TheOC
15 - Aurora
15 - Aurora

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


Bulien
DY1
7 - Meteor

Hi @apathetichell, yes the content type is identical to that used in Postman.

DY1
7 - Meteor

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

DY1
7 - Meteor

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.

TheOC
15 - Aurora
15 - Aurora

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


Bulien
TheOC
15 - Aurora
15 - Aurora

I think the issue is that you need to escape both the '\' and the ' " ', shown by the jsonbuild output:

TheOC_0-1638975720335.png

Cheers,
TheOC


Bulien
DY1
7 - Meteor

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.

Labels