Asana is a web and mobile application designed to help teams organize, track, and manage their work.
In this tutorial, you’ll learn how to connect the Asana REST API to Google Sheets in 5 steps:
Apipheny is a free API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to API data sources, easily.
1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install
2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.
In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.
Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new
1. From within Asana, click your profile photo and then select My Profile Settings:
2. In My Profile Settings, click on the Apps tab and then click Manage Developer Apps:
3. Click +New Access Token:
4. Enter a name for your Token. It can be a description of what you’ll use this Access Token for. Then click the Create token button:
5. Copy and paste your new Asana token somewhere safe. You’ll need it in the next steps.
You will only see this token once, but you can always create another access token later:
Note: If the token/key that you generate has an expiration time, you will need to complete this same process again to get a new token when the old one expires.
In this section, we will show you how to browse the Asana API documentation and obtain an endpoint URL that retrieves the specific information you need from your Asana account.
If you already know your endpoint, or you want to use the same example endpoint as us, just skip to Step 4.
To get an endpoint, first open the Asana API documentation page here: https://developers.asana.com/docs/overview:
The menu on the left contains a list of the available APIs, with each API page linking to a list of its endpoints.
Clicking on an API opens the main page for that API and expands the list of it’s associated endpoints.
For instance, the Asana Users API opens the main page for this specific API and expands the list of its five associated endpoints:
Clicking on an API’s endpoint in the expanded list opens that endpoint’s page.
As an example, this is the URL for the Get user’s favorites endpoint:
https://app.asana.com/api/1.0/users/{user_gid}/favorites
Its documentation page contains a short description, the HTTP method used (GET) and the link you should append to the root API URL (https://app.asana.com/api/1.0/) for querying the endpoint (/users/{user_gid}/favorites):
For endpoints that accept parameters, this documentation is where you will find them listed and explained, along with example inputs and responses.
Note: Check their documentation to confirm the latest version and update the version number in the URL if necessary.
Now, open your Google Sheet back up, with the Apipheny sidebar open (screenshot below). With the Import tab open, enter these details into the add-on:
Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.
API URL: In Step 3, we explained how you can find the Asana REST API endpoint that you need. Now copy the complete URL into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query.
For this example, we are using the Get a workspace API endpoint, to get a specific workspace’s members:
https://app.asana.com/api/1.0/workspaces/workspace_gid/users
The workspace_gid parameter represents the globally unique identifier for the workspace. To obtain it, open your command prompt window for Windows OS or a terminal for Mac OS and make a cURL request to the https://app.asana.com/api/1.0/workspaces endpoint, using the header “Authorization: Bearer access_token”:
Note: For Mac OS you may need to use single quotes ( ' ).
Your access_token is the token you previously generated in Step 2. Please make sure to leave a space between “Bearer” and “access_token”.
Next, if you’re following the same workspace example as me, copy the value after the gid field in the JSON response you receive and paste it in the Get a workspace API endpoint URL that you entered into the API URL field in Apipheny, but replace workspace_gid with your actual gid.
Headers: Next, in the “Headers” section in Apipheny, add two rows with the following keys and values:
Header 1 Key: Accept Value: application/json
Header 2 Key: Authorization Value: Bearer access_token
access_token is the same token value you previously used above, when obtaining the workspace_gid in the command prompt. Here’s what your Asana API request should look like in the Apipheny add-on:
To get the Asana data in Google Sheets, click the Run button at the bottom of the Apipheny add-on and then wait for the Asana API data to be imported into your Google Sheet:
After making a successful request to the Asana API, try querying a different endpoint, or try using one of the more advanced features in the Apipheny add-on.
Schedule requests for automatic updates
Reference cell values in requests
Stack multiple URLs in a single request
Crypto API Tutorials: