Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

cURL to JSON request in Download tool

merrij
6 - Meteoroid

I'm really having trouble understanding the syntax needed for the payload tab for a standard query that is provided by the vendor. The standard query is below. Also below are how I have the header and payload tabs configured. If you can help me understand how I should be translating cURL into something Alteryx can recognize, it would be greatly appreciated.

 

curl -X POST https://api.jwplayer.com/v2/sites/1A23bCD4/analytics/queries/ \

-H 'Authorization: 123Four56==7123Four56==7' \

-H 'Content-Type: application/json' \

-d '{"start_date" : "2019-06-01", "end_date" : "2019-06-02", "dimensions" : ["media_id"], "metrics" : [{"operation": "sum", "field": "plays"}], "sort" : [{"field" : "plays", "order": "DESCENDING"}]}'

 

merrij_0-1617664289466.pngmerrij_1-1617664517916.png

 

3 REPLIES 3
BenMoss
ACE Emeritus
ACE Emeritus

Hi,

 

When you are posting JSON, you need to use one of the two options available at the bottom.

 

My personal preference is to add your JSON string as a new field titles ‘payload’, or something along those lines with a formula tool (then it’s easy to make dynamic), and then using the ‘take body from field’ option and choosing the field you have created.

 

The options you have used in your image creates a form based structure (as specified in the box below it) and not json and this will be why your request is failing. 

Ben

merrij
6 - Meteoroid

I see, that makes sense. Are you aware of any resources that specify the required syntax for the JSON payload? Below is what I get using an online converter for cURL to JSON and I am getting the error that my request is invalid and contains invalid JSON.

 

merrij_0-1617716609154.png

 

50ld13r
7 - Meteor

Did you get this resolved?  Seems to be very similar to a problem I have.

Labels