How to hit the Asana API

Asana's API lives at https://app.asana.com/api/1.0. Responses wrap results in data; add opt_fields to get more than names and ids.

Authentication

Get a personal access token at app.asana.com. Send it as Authorization: Bearer <token>. In the examples it's written {{ASANA_TOKEN}}.

Full reference: https://developers.asana.com/reference/rest-api-reference

Get the current user

Includes your workspaces.

curl https://app.asana.com/api/1.0/users/me \
  -H "Authorization: Bearer {{ASANA_TOKEN}}"
Run in PostTaco

Your tasks in a workspace

curl "https://app.asana.com/api/1.0/tasks?assignee=me&workspace={{WORKSPACE_ID}}&opt_fields=name,due_on,completed&limit=10" \
  -H "Authorization: Bearer {{ASANA_TOKEN}}"
Run in PostTaco

Create a task

curl -X POST https://app.asana.com/api/1.0/tasks \
  -H "Authorization: Bearer {{ASANA_TOKEN}}" \
  -H "Content-Type: application/json" \
  -d '{"data": {"name": "Created from PostTaco", "workspace": "{{WORKSPACE_ID}}", "assignee": "me"}}'
Run in PostTaco