We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

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 

16 REPLIES 16
TheOC
16 - Nebula
16 - Nebula

hey @DY1 

No worries - sorry it hasn't resolved your issue so far - i was just wanting to try the json build as a double check for the escape characters.

This is a bit of an awkward one, especially with not having access to the API. What is the error message exactly? If the request is being made - but you are receiving the error from the site - you could try using fiddler to see the request (and compare against postman request) 

 

Hope this helps,
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
DY1
7 - Meteor

@TheOC the response message is "Unable to parse the JSON".  As you say, very hard to be able to diagnose/test theories without access.  I have tried fiddler and cannot really see whats going wrong to be honest.

 

thanks for taking the time.

jcagle
5 - Atom

This worked for me:
add a header in the Headers tab of the Download tool with the name "Content-Type" and a value of "application/json" (without the quotes). 

mrdoughnutssalt
5 - Atom

Just came across this topic as I was facing the same issues that the REST API endpoint could not parse the JSON format. What solved it for me was changing the payload type. In the payload tab, I chose the option "Take Query String/Body from Field" and then selected the field containing my the compact formatted JSON string

JohnWood
6 - Meteoroid

I am having a related issue. Works in Postman but not Alteryx. I pass (date range) filter parameters on the payload tab but they are ignored and returns the default latest 15 mins of records.

JohnWood_0-1666173984483.png

 

Verakso
11 - Bolide

For what it worth, I had the exact same problem, that's why I came here.

 

In postman, my json body is posted as "raw", 

2024-01-18 18_37_49-New Request - My Workspace.png

 

 

 

  

 

 

So to do the same in the Download Tool, well - then this worked for me ;)

 

2024-01-18 18_38_51-Alteryx Designer x64 - New Workflow1_.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EDIT:
Forgot to mention, that I also set the headers to this:

2024-01-18 18_43_41-Alteryx Designer x64 - New Workflow1_.png

deepakantony329
5 - Atom

Thanks @Verakso Mine worked after adding "Accept" to Header.

Labels
Top Solution Authors