GETting API Authorization with Basic Authentication on Alteryx

by Erlina Cahyadi

Are you looking to GET some data using an API? Does your API require an authentication key? Are you unsure how to get said authentication key?

If your answer is yes to any of these questions, you have come to the right blog.

When starting out with APIs, you might have noticed that different APIs have different requirements. Some don’t give you any trouble and allow you to retrieve all the data you want for that specific site (i.e., Rick and Morty API). Others make you jump through hoops like requiring a Basic Auth or OAuth and asking for an encrypted authentication key with the original key (i.e., Lever API). Please note that different API documentations use different terminology for similar parts.

Today we’re going through the different hoops of basic authentication with a few various APIs.

But first, how do we retrieve data on Alteryx through an API? We need the download tool and a URL (usually inserted in a text input tool) to direct it to the location of the data.

You can usually get the URL from the API documentation formed as a root/base URL or an example call URL, which can be used to identify the root URL.

Base/Root URLs


Example Call URLs

Base URL is highlighted.

As shown in the example call URL directly above, additional paths and path parameters are added after the root URL to further define the specific fields we are looking to extract. The API documentation will inform which paths and path parameters to use for the desired fields. Once we have defined what we want in the URL, we can insert the URL into the Text Input tool as shown below and connect it to the download tool as shown below.

Once connected, the download tool may automatically assign the URL field to the Field section under the Basic tab and check the Encode URL Text box from a string to a Field.

When pulling data from a site with an API, we use the GET method on the Payloads tab for the HTTP Action section. The API documentation will also provide information on which HTTP method to use for the action you’re looking to do.

At this point, if you were to run the workflow for an API that requires authorization, an error message would return in the results pane underneath the DownloadData and DownloadHeaders columns, indicating that you are unauthorized.


Different websites have varying requirements and steps to retrieve an authentication key. Usually, these steps can be found easily on the API documentation or Google. Once you have your key, there are multiple ways to gain authorization to the data. We are going to go over some of the more common cases in this blog.

One common case is the key may be embedded into the URL.

Another common case is in the Headers tab: click the Add button to insert “Authorization” or the instructed value from the API documentation under the Name column and key under the Value column.


As used in the example above, the Lever API documentation below states that it requires users to use “Authorization” as the user-id and the password as “Basic [Key].”


Alternatively, you can turn the user-id and password into a field to get authorization.  To achieve this, create a new field in the text input tool and label the column “Authorization” or the instructed value from the API documentation, followed by the authentication key on the first row, as shown below.


Instead of adding a new constant value, all that is needed is a check of the field created in the section underneath as we have done below.


Some APIs may require an extra step in the authorization process. The Lever API, for example, requires its users to encode their keys when requesting authorization.

This is easily achievable, as there are many free converters online, such as https://www.base64encode.org/. For Lever, specifically, it states to use a “base64 encoded string in the credentials”. So, below we have taken the generated key and inputted it into the converter to output the encoded string to use as the new password.


Take the original generated key and replace it with the new encoded key on Alteryx, as shown in either of the examples below.


These authorization options can also apply to PUTing, POSTing, or DELETE-ing data.

Some APIs may require you to authorize in a specific way, but the end goal is the “OK” without any errors in the result pane.

Hopefully at this point, you understand how to get authorization for an API using basic authentication.