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.
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.
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.
2. Name the Power-Up and select a Workspace.
3. Fill in the Email, Support contact, and Author fields, then click Create.
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.
You should now see your API key and secret. You can leave the tab open so you can copy them later.
5. Add the following URL to the Allowed origins field and click Add.
https://oauth.datafetcher.com/auth/callback
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.
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.
3. Once you've logged in, click Create your first request.
We'll set up the request to get data from Trello's API.
1. Select Custom under Application.
2. Name the request "Import Trello boards".
3. Click the Authorization tab under the URL field, then select OAuth under Type.
4. Click + New next to Connection.
5. Click Create custom OAuth connection in the dialog that opens.
1. Enter "Trello" under Name, then select OAuth1 under Type.
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
3. Enter "HMAC-SHA1" under Signature Method.
4. Copy and paste your Trello API key and secret into the Consumer key and Consumer secret fields, respectively.
5. Enter "read" under Scopes, then copy and paste https://api.trello.com/1/ under Base URL.
6. Click Create connection. The Trello authorization dialog will open.
7. Scroll down and click Allow to authorize Data Fetcher.
All the dialogs will close and you'll be back on the request screen.
1. Copy and paste this URL into the URL field.
https://api.trello.com/1/members/me/boards
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.
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.
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.
2. Click the checkbox next to "Name", then click Existing field and select "Name".
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.
Here's an overview of what you need to use an OAuth 1.0 API in Airtable.
That's all for this tutorial. Check out our blog for more on custom API requests.
Oct 7, 2024
•Zayyad Muhammad Sani
•Custom RequestsData FetcherAug 20, 2024
•Zayyad Muhammad Sani
•Custom RequestsAug 19, 2024
•Zayyad Muhammad Sani
•Custom Requests