Alteryx Designer Desktop Discussions

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

Download Tool - HTTP/1.1 400 BAD REQUEST

AKPWZ
8 - Asteroid

Hi everyone,

A quick question - 
This is the URL I'm using to fetch the data from a source - "https://xyz.com/api/company?limit=30&order_by=created_datetime%3Adesc" with Authorization: "Basic sample_skhf48ifwlfnekf=".

This is working absolutely fine in Postman but not in Alteryx (download tool) and I'm getting an error of 400=>  "HTTP/1.1 400 BAD REQUEST"

DownloadData = {"error": {"msg": "Failed to retrieve company.", "data": {"order_by": ["Not a valid choice."]}}} 

 

Could you please help on this please. Thank you!

4 REPLIES 4
ArnaldoSandoval
12 - Quasar

Hi @AKPWZ 

 

Please watch the following video API's in Alteryx the video has a long introduction, but its content is top knoch. I wrote the Guardian-API he is talking about, and I attaching it; You got postman working, so focus on that part, to review your transition from Postman to Alteryx, if you still experience issue let us know, we will try to walk your alteryx workflow.

 

hth

Arnaldo

 

 

apathetichell
18 - Pollux

Postman includes additional headers and auto-determines things like content_type - Alteryx does not.  Dive into the additional headers and see what you are missing.

 

Also - don't post your authorization here - even when encoded.

SeanAdams
17 - Castor
17 - Castor

Hey @AKPWZ 

I've also struggled from time to time with the download tool because as @apathetichell mentioned, postman is sending different things down the wire than the Download tool is, and there's no way to inspect exactly what the download tool is sending.

 

In cases like this - I generally pop a Python tool on the canvas and start doing this through Python

 

The great thing about Postman is that it generates the python code for you - just google for "Postman Generate Code" - so you if you have a working postman call, you can get python to generate the python request code, and then you can see exactly what's going on.    Additionally this is easier to debug because if you can't get it working in Python tool in Alteryx you can remove one compounding variable by doing it in plain old python to figure out packages etc (but generally simple API calls just work).

 

I know that Python can be a bit of a learning curve for some - but with Postman generating the code; and the era of Chat GPT helping to generate code - it should be achieveable for anyone - and it gives you super-tight ability to inspect and control what's going on.

 

Also - if you have any ideas from your own personal experience about how to make the Download tool / API experience better - drop an idea into the Ideas section here: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Ideas/idb-p/product-ideas

 

cc: @NicoleJ 

Labels