Alteryx Designer Discussions

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

Download Tool - API with cURL

10 - Fireball

I am struggling to get the Download tool to download data through an API using cURL.  I unfortunately have no documentation, just that the request needs to be in the form of:  


curl -fSsL -u [MY API KEY]: "[MY URL]" -o [MY FILE NAME].csv.gz

Where I've put in the applicable values for the API key, URL, and File Name (scrubbed here for privacy).  I'm not sure how this translates into options in the Download tool, I've played around with different options to try and get it to work, but keep getting a "not authenticated" error. 


API cURL question.PNG

I hope this is an appropriate question to ask given I can't share much about the actual API I'm using and that I'm new at APIs outside the context of Weekly Challenges!  🙂  Thanks.


5 - Atom

That being said I usually only ever use a text field for the api URL and the keys are usually put inside of the headers of the download tool itself. 


As far as the output I usually run the json or xml through some processing before I use a normal output tool to dictate where it goes.



On more complicated APIs I start by trying to get it to work through SOAPui first and then copy the complexities to the download tool.

16 - Nebula
16 - Nebula

This should be fairly reproducible.


Looking at the arguments to cURL, you are downloading a binary file (GZipped) and have a username as specified by the -u. How the user is passed varies depending on protocol. Alteryx doesn't support reading this from a field but it could be done using a batch macro. If it is constant then you can put it in the Connection tab of the download tool.


One other option would be to use RunCommand to execute cURL.

5 - Atom

Perhaps this is helpful ... it shows how to setup the request to a URL and provide an api_key.

10 - Fireball

Thanks all!  The issue connecting turned out to be with the zipped files.  They changed that and I was able to get the API to work by editing the headers in the Download tool.  


I'm not sure if there's a way to delete or close out this thread?  Thanks!

5 - Atom

I'm running into a similar kind of problem. I am new to APIs and facing issue configuring Detect Language API ( into Alteryx.



The result that I see is:



My configuration in Download tool is:







Wondering if anyone would know why am I getting a Bad request error?