How to Connect to an OAuth 1.0 API in Airtable

Sep 20, 2024Zayyad Muhammad Sani

In this tutorial, you'll learn how to connect to an OAuth 1.0 API in Airtable. Using Data Fetcher, you'll connect to Trello's API, get the list of Trello boards in your workspace, and display the list in Airtable. You can use the same steps to connect to any other OAuth 1.0 REST or GraphQL API in Airtable without code.

What is OAuth 1.0?

OAuth 1.0 is an authorization protocol that allows people to use their identity from a website (like Google or Facebook) to access third-party websites and apps without a password.

Nowadays, many APIs use the newer OAuth 2.0 protocol for authorization. However, some APIs like Etsy, X, and Trello still use OAuth 1.0.

Let's get started with Trello's OAuth 1.0 API.

Generating an API Key

Before accessing Trello's API, we'll have to create a Trello Power-Up and then generate an API key for that Power-up.

1. Visit Trello's Power-Ups admin page, then click the New button.

create-powerup-trello.png

2. Name the Power-Up and select a Workspace.

name-powerup-trello.png

3. Fill in the Email, Support contact, and Author fields, then click Create.

author-details-trello-powerup.png

Trello will create the Power-Up and redirect you to the API key screen.

4. Click Generate a new API key. A dialog will open showing a notice from Trello. Click Generate API key in the bottom right corner of the dialog.

generate-api-key-trello.png

generate-api-key-dialog-trello.png

You should now see your API key and secret. You can leave the tab open so you can copy them later.

api-key-and-secret-trello.png

5. Add the following URL to the Allowed origins field and click Add.

https://oauth.datafetcher.com/auth/callback

add-data-fetcher-callback-trello.png

With this URL, Trello will redirect you to Data Fetcher once you authorize the API in Airtable.

That's all the setup we'll do in Trello. Let's move on to Data Fetcher.

Adding Data Fetcher to Airtable

1. Add the Data Fetcher extension to your Airtable base.

2. Sign in to Data Fetcher or sign up if you don’t have an account.

sign up for data fetcher.png

3. Once you've logged in, click Create your first request.

create your first request logo 2 smaller.png

How to Connect to an OAuth 1.0 API in Airtable

We'll set up the request to get data from Trello's API.

1. Select Custom under Application.

select custom request.png

2. Name the request "Import Trello boards".

name-request-trello.png

3. Click the Authorization tab under the URL field, then select OAuth under Type.

authorization-tab-trello.png

4. Click + New next to Connection.

new-oauth-connection-trello.png

5. Click Create custom OAuth connection in the dialog that opens.

create-custom-connection-trello.png

Creating the OAuth 1.0 Connection in Airtable

1. Enter "Trello" under Name, then select OAuth1 under Type.

name-and-auth-type-trello.png

2. Enter these URLs for the following three fields. If you're using a different OAuth1 than Trello, these URLs will be different. Check the API documentation's Authorization section to find the relevant URLs.

Request token URL -> https://trello.com/1/OAuthGetRequestToken

Access token URL -> https://trello.com/1/OAuthGetAccessToken

User Authorization URL -> https://trello.com/1/OAuthAuthorizeToken

urls-trello.png

3. Enter "HMAC-SHA1" under Signature Method.

signature-trello.png

4. Copy and paste your Trello API key and secret into the Consumer key and Consumer secret fields, respectively.

consumer-key-and-secret-trello.png

5. Enter "read" under Scopes, then copy and paste https://api.trello.com/1/ under Base URL.

scopes-and-url-trello.png

6. Click Create connection. The Trello authorization dialog will open.

authorize-data-fetcher-trello.png

7. Scroll down and click Allow to authorize Data Fetcher.

allow-data-fetcher-trello.png

All the dialogs will close and you'll be back on the request screen.

Making the API Request

1. Copy and paste this URL into the URL field.

https://api.trello.com/1/members/me/boards

boards-url-trello.png

2. Click Save and Run in the bottom right corner to run the request.

Just one more step before importing the list of Trello boards in your table.

Mapping Response Fields

When Data Fetcher runs a request for the first time, you'll need to select and configure the fields you want to import on the Response field mapping screen.

response-field-mapping-trello.png

The Trello board names are in the response data's "Name" field, so you'll import and map it to the default "Name" field in your table.

1. Click Deselect All from the toolbar at the top right of the screen.

deselect-all-trello.png

2. Click the checkbox next to "Name", then click Existing field and select "Name".

select-name-field-trello.png

3. Click Save and Run. Data Fetcher will set the relevant OAuth 1.0 Authorization header when connecting to the API, and import the data into Airtable.

Check your table, and you should see the list of Trello boards.

board-names-imported-trello.png

Here's an overview of what you need to use an OAuth 1.0 API in Airtable.

  • Create an OAuth 1.0 app or integration on the website you want to connect to.
  • Generate your API key and secret from the website.
  • Get all the information you'll need to make an API request from the website's documentation.
  • Add Data Fetcher to your Airtable base.
  • Create a custom OAuth 1.0 connection in Data Fetcher using the details you got earlier.
  • Make the API request and import fields from the response data.

That's all for this tutorial. Check out our blog for more on custom API requests.

Related Posts

How to Make an HTTP POST Request in Airtable

How to Make an HTTP POST Request in Airtable

Aug 20, 2024

Zayyad Muhammad Sani

Custom Requests
How to Fetch Data from an External API in Airtable

How to Fetch Data from an External API in Airtable

Aug 19, 2024

Zayyad Muhammad Sani

Custom Requests
Connect to an API with Bearer Token Authentication in Airtable

Connect to an API with Bearer Token Authentication in Airtable

Aug 8, 2024

Zayyad Muhammad Sani

Custom Requests