This is part one of our tutorial series on working with the Airtable API in dashdash. Just make sure that you’ve set up your views as in the introductory article.
In this tutorial, we’ll learn how to create the authorization header for Airtable.
We’ll go through how to:
- set up the request header
- set up the action URL
But first, let’s set up our Support view by creating the following header rows:
|D1||Bearer and Key|
It should look a little like this:
Next, let’s set up the request header.
Setting up the request header
In order to set up the header, we first need to get our Airtable API key. You’ll only need to do this step once per Airtable account.
To get you Airtable API key:
- Go to your Airtable account overview at www.airtable.com/account.
- Click Generate API key.
- Copy and paste your API key into cell C2 in the Setup view.
Great! Now we can access the Airtable API documentation.
- Go to https://airtable.com/api.
- Select the Airtable base you want to use. For the purposes of this tutorial, we’ll use the Content calendar base.
- In the left-hand navigation menu, select Authentication.
In the example on the right, we can see how to build our request header:
To build this header, let’s enter the following content in our Setup view.
|A2||Authorization||Used in the API header.|
|B2||Bearer||Used in the API header.|
|C2||(This should already contain your API key)||Our Airtable API key.|
||This formula will concatenate
||This formula will create the JSON header we need to send in each of our requests to AirTable.|
If you’ve done everything correctly, in the end when you click the Data Explorer icon in cell E2, you should see this in the data explorer panel.
Perfect! Now we have our header! The next thing we need to do is to set up the action URL (the URL that we’ll use to send data to).
Setting up the action URL
To set up the full action URL, we’ll need to get the following information from our Airtable API documentation:
- Base ID (this changes per Airtable base)
- View name (this changes per Airtable view)
Luckily, the Airtable documentation provides us with all the information we need! If we look back at the Authentication section, you’ll notice the URL is already provided.
So now, let’s just update our Setup view with the following content:
|B5||Your Base ID|
|C5||Your View name|
The last formula, in cell D5, will create our entire action URL - perfectly formatted
Note: If you have spaces in your view name, we need to URL encode them. Basically, we need to replace all your spaces with
%20. For example, if your view name is
dashdash is awesome, then in C5 you should write:
In the end, your Setup view should look like this:
And that’s it! You’ve just created all the necessary parts to start retrieving data from Airtable. So let’s get some data!