Asana

How to connect Asana to Village Labs

Personal Access Token

  1. Open Asana. Navigate to Settings (Top right) > Apps > View Developer Console (bottom of modal)

  2. In the 'Personal access tokens' section of My Apps, click Create new token.

  3. Name it Village Labs

  4. Save your token in a secure password sharing platform like LastPass or 1Password and share with the Village Labs team.

OAuth 2.0 Authorization Flow

Since Asana uses OAuth 2.0, the process for connecting to Asana involves a few additional steps compared to simple API key access.

  • Create an OAuth Application:

    • Go to Asana’s developer console at Asana Developer App Console.

    • Create a new OAuth application.

    • You will receive a client_id and client_secret that will be used in the OAuth flow.

  • Redirect URI:

    • As part of the OAuth process, you will need to specify a redirect URI where Asana will send the authorization code after the user approves access.

  • User Authorization:

    • Direct the user (admin) to the authorization URL generated with your client_id and redirect URI.

    • The user will be prompted to log in and approve the requested scopes (permissions) for your application. For your use case, you will likely request read permissions to tasks, projects, comments, and user information.

  • Access Token Exchange:

    • After the user approves access, Asana will redirect them to your specified URI with an authorization code.

    • Exchange this authorization code for an access token using your client_id and client_secret.

  • Store Access Token:

    • Store the access token securely. This token will allow your application to access the Asana API on behalf of the user.

  • Access Asana Data:

    • Use the access token to make API requests to Asana and retrieve data such as tasks, comments, user information, etc.

Permissions

Ensure that you request the appropriate scopes based on what data you need to access. For your use case, you might consider the following scopes:

  • default: Grants access to read and write all user data.

  • tasks:read: Grants read-only access to tasks.

  • projects:read: Grants read-only access to projects.

  • workspaces:read: Grants read-only access to workspaces.

Handling Tokens

  • Token Expiry and Refresh: OAuth tokens can expire, so you'll need to handle token refreshes using the refresh_token provided during the token exchange process.

Last updated