Accessing Asana data using Postman

Postman is an application (Desktop or Web) that can be used to access the Asana API (as well as many others). There is a whole language around APIs that can get pretty confusing so follow this step-by-step guide below to get at your Asana data with the minimum of fuss.

This process covers use of the Web Application which is almost identical to the Desktop Application. So let’s get on with Using Postman to access your Asana data!

Sign up for a Postman account

Go to https://www.postman.com/ and sign up.

Screenshot of Postman Sign Up Page

On clicking “Create Account”, I filled in a brief form supplying some additional information for my account.

The next step, “Collaborate with teams” can be skipped. Click “Continue without a team”.

Screenshot of Postman Sign Up Process

This should bring you to a welcome screen.

Welcome page for Postman web app

If you signed up via email, you will probably have received a confirmation email by now. Be sure to confirm your email.

Set Up Postman

On the left hand side of the screen above, you will see a link labelled “Workspaces”. Click on that link and select “New workspace”.

Setting up workspaces in Postman

Your new workspace name should reflect what you are currently working on. Under visibility, select “Personal” from the drop down and then click on “Create Workspace”.

Create a new workspace in Postman

You will now be brought to the your newly created workspace. To organise our workspace, we first need to create a collection. Keep in mind that we are using postman in a very simple way, so we do not need to worry too much about how we organise our work.

New collection creation within Postman

In this case, I called my collection “Basic Asana Reporting”.

Adding a request to a Postman collection

Retrieving data from Asana’s API

To get started with talking to the Asana API. Click on the “Add a request” link (Look at the text underneath the area highlighted in red on the previous image).

Postman usually requires some technical understanding of APIs – I am assuming that the reader is here because they do not have this technical knowledge so, for your own sake, it is probably best to just follow the steps without worrying too much about understanding all the terminology.

By default, all new requests in Postman are “GET” requests, leave that as is.

A new GET request in Postman

To get started, we are going to request a full list of all the current projects in Asana for our organisation.

We need to get two things prior to submitting requests to Asana’s API.

  1. A Personal Access Token
  2. Your Asana Workspace ID

Personal Access Token or PAT

Using Postman to access your Asana data requires an Asana generated PAT.

Within the Asana Webapp, go to “My Profile Settings” accessable by clicking on your profile picture at the top right of the app.

Where to find "My Profile Settings" on Asana's menu

Click on the Apps tab and select “Manage Developer Apps”

Where to find "Manage Developer Apps" in Asana's profile settings.

Click on “+ New Access Token”

Generating a new Personal Access Token in Asana

Give the token a name and agree to the Ts & Cs.

Naming a new Personal Access Token in Asana

Click Create Token. A token looks like a long string of random characters roughly 50 characters in length.

Note – You should never share the token with anyone. Keep it safe.

Copying a new Personal Access Token in Asana

Copy the token and go back to Postman. Select the “Authorization” tab and select “Bearer token” from the drop down.

Setting up authorizations for the Asana API in Postman

Paste your token into the field provided.

The location of the token when setting up an Asana GET request in Postman

Your Asana WorkSpace ID

Visit https://app.asana.com/api/1.0/workspaces in the same browser where you are logged into to Asana. You should see a long string listing all of the workspaces you have access to. Each workspace will have a long number called a “gid” associated with it. Grab the gid for the workspace you are interested in. It should look like a long number about 13 digits in length.

Finally – Retrieving data from Asana with Postman

At last, in Postman, paste the following URL into the GET field. (Replace the text <<ENTER YOUR gid HERE>> with your actual gid obtained in the last step).

https://app.asana.com/api/1.0/projects?workspace=<<ENTER YOUR gid HERE>>&limit=100&archived=0&opt_fields=created_at,owner.name,public,name,archived,is_template

You will notice when you do this that Postman automatically creates some Param fields.

An example of a GET request for Asana's API in Postman

Click the large blue “Send” button on the right hand side of the Postman screen. After a few seconds you should see a response. Hopefully not an error message. You want the Status of the response to be “200” and a large JSON string to appear in the lower portion of your screen. (JSON is simply a way of formatting data, note the curly crackets, quotes and colons).

Retrieving results from Asana's API in Postman

More than 100 projects in your Asana Workspace? In that case, you need to deal with “Pagination”. To limit the workload on their API, Asana allows you to access only 100 records at a time. (Hence the parameter “limit” above).

To see the remaining projects, grab the full JSON from Postman and copy it into a text editor such as Notepad.

Where to find the Offset token in Asana's API results in Postman

Copy the extremely long string labeled “offset”. You need everything inside the double quotes. This needs to be added as a new parameter in Postman. Under the Params tab, add a new Key / Value.

Adding a new key in Postman

The key should be set to “offset” and the value should be the very large string copied from the first JSON. Once entered click “Send” once more.

Note: If you take too long, you may receive an error “offset: Your pagination token has expired.” In this case, untick the checkbox beside the offset Key and re-Send. This will give you the first 100 projects again with a new offset string at the bottom. Re-tick the checkbox beside offset, copy the new offset keyinto the Value field opposite the offset key. Click Send.

Adding a Offset to an Asana GET request in Postman

That’s it – You may have to repeat this last step if you have greater than 200 projects. Eventually your JSON will not have an offset value for you to copy.

The end of the results fetched from Asana's API in Postman

Congratulations – You have completed the guide to using Postman to access your Asana data.