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:

  1. Install the Apipheny Add-on
  2. Get an Asana Access Token
  3. Choose an Asana Endpoint URL
  4. Enter your Asana API Request into Apipheny
  5. Run the Asana API request

Step 1.) Install and open the Apipheny Add-on in Google Sheets

To pull data from the Asana API to Google Sheets easily and without writing any code, first install and open the Apipheny Google Sheets add-on.

Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs (including the Asana API), save API requests, schedule API requests, and more. Click here if you want to learn more about Apipheny.

1. Install Apipheny by clicking the Install button on this page.

Install Apipheny
Install Apipheny

2. After you’ve installed Apipheny, open a Google Sheet and then click on Add-Ons in the menu at the top. In the Add-ons menu, you should see Apipheny.

Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets:

Open Apipheny
Open Apipheny

Step 2.) Get an Asana Access Token

1. From within Asana, click your profile photo and then select My Profile Settings:

Go to Asana Profile Settings
Go to Asana Profile Settings


2. In My Profile Settings, click on the Apps tab and then click Manage Developer Apps:

My Profile Settings > Apps > Manage Developer Apps
My Profile Settings > Apps > Manage Developer Apps


3. Click +New Access Token:

Click New access token
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:

Create Asana Token
Create Asana Token

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:

Step 3.) Choose an Asana Endpoint URL

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:

Asana API Documentation
Asana API Documentation

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:

  1. Get multiple users
  2. Get a user
  3. Get a user’s favorites
  4. Get users in a team
  5. Get users in a workspace or organization
Asana Users API
Asana Users API

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):

Asana API - Get User's favorites endpoint
Asana API – Get User’s favorites endpoint

For endpoints that accept parameters, this documentation is where you will find them listed and explained, along with example inputs and responses.

Step 4.) Enter the Asana API URL into Apipheny

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 and make a cURL request to the https://app.asana.com/api/1.0/workspaces endpoint, using the header “Authorization: Bearer <access_token>”:

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:

Key 1:
Accept
Value 1:
application/json
Key 2:
Authorization
Value 2:
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:

Asana API request in Apipheny Google Sheets add-on
Asana API request in Apipheny Google Sheets add-on

Step 5.) Run the Asana API Request in your Google Sheet

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:

Asana API data in Google Sheets
Asana API data in Google Sheets

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, such as:

  • Save and schedule your API request
  • Make a POST request (if available)
  • Use the custom =APIPHENY() function to call the API request inside your spreadsheet
  • Create an API request by referencing the value of a cell in the API URL with three curly braces eg. {{{Sheet1!A1}}}

Related articles:

Related Posts

Leave a Comment