Alteryx Designer Desktop Discussions

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

How to POST JSON to REST API

PiotrJarzyna
6 - Meteoroid

I have a REST API with method POST that expects data in JSON format in the body. I am trying send data from Alteryx (DownloadTool) to this API calling the POST method, but with no success. I receive various errors 400 / 415 etc. Could you please explain how to configure DownloadTool to post to REST API?

 

Example errors:

 

DownloadData
{"Errors":["The request entity's media type 'application/x-www-form-urlencoded' is not supported for this resource."],"StatusCode":415}

 

DownloadHeaders
HTTP/1.1 415 Unsupported Media Type
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 135
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
P3P: policyref="/w3c/p3p.xml", CP="NON COR CURa ADMa DEVa OUR NOR"
Date: Sat, 20 May 2017 15:16:52 GMT

 

Kind regards,

Piotr

16 REPLIES 16
deethesh
5 - Atom

Thanks Nick  , Sophie : 

 

I'm able to extract the JSON response after adding below Header :

 

user-agent
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
 
 
kcabrera
5 - Atom

The link for the slack API example is not working for me.  Is it still available?

davidhenington
10 - Fireball

looks like that link has been down for a while. 

davidhenington
10 - Fireball

@NickJ wrote:

Hi Piotr,

 

Not a direct answer to your problem, but have you seen this great post on the Slack REST API? (https://community.alteryx.com/t5/Portland-ME/Meeting-2-in-the-books/gpm-p/32526#M14)

 

It gives you a pretty good example (including a workflow) of using a POST action on an external API

 

Cheers,

Nick


Hi Nick, having same issue and am troubleshooting. That link is dead. 

Anshita
8 - Asteroid

Hi @PiotrJarzyna ,

 

I myself am trying to create JSON but unable to do so. I see that you have already created one yourself, can you please direct me to some good material that I can use to create my own json string. I am currently using the JSON Builder and my data looks good but it is not working for me. 

 

 

Thanks

IraWatt
17 - Castor
17 - Castor

Thanks, @GavinAttard your way worked for my request to post some JSON 👍

Jay2022
8 - Asteroid

@GavinAttard  Good morning! Reading up on this post I wonder if you could help me. I have a workflow design to send a series of data via API. First we need to convert a cvs file into json one row at the time and send that via POST. but I keep getting the below error as if the reeiver is not getting it. Can you help with the design or a better way to do this. I am using an url, client_secret, clientId and grantType credentials from the receiver. It works on Postman if i send each row at the time json style and after i received a bearer token.

 

I am very new at API and fairly ok with Alteryx so all the help I can get would be appreciated.

 

 
 

 

 

 

 

Labels