This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
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.
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.
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.
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.
Perhaps this is helpful https://community.alteryx.com/t5/Engine-Works-Blog/REST-API-In-5-Minutes-No-Coding/ba-p/8137 ... it shows how to setup the request to a URL and provide an api_key.
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!
I'm running into a similar kind of problem. I am new to APIs and facing issue configuring Detect Language API (https://detectlanguage.com/) 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?