Search API Connector Documentation

Print

Import Asana Data to Google Sheets

In this guide, we’ll walk through how to pull tasks from the Asana API directly into Google Sheets, using the API Connector add-on for Sheets.

There are 2 ways to connect to the Asana API:

  • Preset “Connect” button (OAuth) premium
  • Personal access token. Please check the appendix for detailed instructions to retrieve your token.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Connect to the Asana API

The easiest way to get started with the Asana API is through API Connector’s built-in integration.

  1. Select Asana from the drop-down list of applications
    asana-application
  2. Under Authorization, click Connect to Asana
    asana-authorization
  3. You be asked to authorize the connection. Click Allow.
    asana-img2
  4. You’ll then be returned to your Google Sheet, and can verify that your Asana connection is now active.
    asana-authorization-connected

Part 2: Fetch Data from Asana

Now that we’re connected, let’s pull some data into Sheets.

  1. Under Endpoint, choose Get your workspaces. This will return your workspace ID(s), which you’ll need for subsequent requests.
    asana-endpoint
  2. There are no other required parameters for this endpoint, so just select a destination sheet, name your request, and click Run. You’ll see your workspace ID returned in the data.gid field.
    asana-response
  3. You can now plug this value into other requests. For example, the /projects endpoint can accept a workspace ID as a filter.
    asana-workspace

Part 3: Create a Custom Request

Alternatively, you can create a custom request instead of using API Connector’s built-in integration. When you create a custom request, you add your complete URL into the request URL field and select Asana from the OAuth menu.
asana-img6

Part 4: More Example API URLs

Here are some more examples of custom API URLs.  Check the documentation for the full list of possible requests.

  • Retrieve all your tasks
    https://app.asana.com/api/1.0/projects/PROJECT_ID/tasks

    Replace PROJECT_ID with your project ID (run a request to the /projects endpoint or click on your project and check the URL bar to see this value).

    asana-img7
  • Create a new task
    POST https://app.asana.com/api/1.0/tasks?projects=PROJECT_ID&workspace=WORKSPACE_ID

    As noted earlier, find your PROJECT_ID value from the URL bar in the interface, and get your WORKSPACE_ID from your initial https://app.asana.com/api/1.0/users/me request. Input your task details into the POST body as described in the documentation, like this:

    api-connector-asana-img11

    You will immediately see your new task reflected in your Asana dashboard. Note that you can only create one task at a time with this method.api-connector-asana-img12

Part 5: Handle Pagination

Asana recommends using pagination when retrieving large result sets, to break responses into smaller sets. If your response set is too large, you may receive an error like this: “The result is too large. You should use pagination (may require specifying a workspace)!” To resolve this issue, paginate your response by using the ‘limit’ and ‘offset’ parameters as described in the documentation.

In API Connector, you can cycle through these paginated requests automatically using pagination handling (paid feature), like this:

  • Pagination type: next page URL
  • Next page path: next_page.uri
  • Run until: choose when the request should stop running
    asana-pagination-next-page-url

Part 6: API Documentation

Official API documentation: https://developers.asana.com/docs

Appendix: Connect with an Asana Personal Access Token

This method is a free alternative to the method described above. Instead of clicking Connect, retrieve your own personal token.

  1. Log in to Asana and click your profile icon in the top right corner to open the profile drop-down menu. Click ‘My Profile Settings’
    api-connector-asana-img1
  2. From the My Profile Settings menu, click Apps
    api-connector-asana-img2
  3. Click Manage Developer Apps
    api-connector-asana-img3
  4. On the Developer Apps screen, click “+New Access Token”
    api-connector-asana-img4
  5. A screen will open, prompting you to provide a name. You can name it whatever you like, but here we’ll name it Google Sheets. Check the terms and conditions box, and click Create Token.
    api-connector-asana-img5
  6. You’ll now see your Token. Congrats! Copy it to your clipboard.
    api-connector-asana-img6
  7. To use this token, under Headers, enter Authorization as your Key, and Bearer YOUR_TOKEN as your Value, like this:
    api-connector-asana-img8
  8. Your requests should run as described in the Custom requests section. Just make sure to select OAuth = None as you’re connecting with a token instead.

Previous Import AppsFlyer Data to Google Sheets
Next Import BambooHR Data to Google Sheets

4 thoughts on “Import Asana Data to Google Sheets”

  1. can we use this API method to pull data from asana to google sheet? specifically to pull all the tasks (both not completed and completed for all members in the asana)

    Reply

Leave a Reply to Andrew Arnov Setyawan Cancel reply

Table of Contents