Asana API for node
Ultimately, a support in the browser, using node-browserify is also planned.
Asana = require "asana" asana = new Asana key : "deadbeef" asana.user.fetch success : -> ... error : -> ... users = new asana.Users users.fetch error : -> ... success : -> workspaces = new asana.Workspaces workspaces.fetch error : -> ... successs : -> workspace = workspaces.first task = new asana.Task assignee : users.find (user) -> user.get("name") == "John Difool" followers : [user] name : "Protect the Incal" workspace : workspace task.save error : -> ... success : -> ...
Get the facts!
- Base reference: Asana API
- All asana items are backbone models. You can fetch and save them as is usually done with backbone models. However, asana API does not allow to create or save some items.
- Backbone models support ID map and modelize as provided by backbone.modelizer
- All asana attributes are stored as model attributes. Creation arguments are those documented in the Asana API.
- It is possible to pass models or IDs as attributes values.
- Items structure is:
asana = new Asana key : asanaKey:
asana.user: Current asana user
asana.Users: Collection of all known users
asana.Stories: Collection of all stories
asna.Workspace: Basic model for asana workspaces
asana.Workspaces: Collection of all asana workspaces
asana.Project: Basic model for asana projects
project.workspace: Workpace for
asana.Projects: Collection of all asana projects
asana.Task: Base task model
asana.Tasks: Collection of available tasks.
task = new asana.Task params:
task.Story: Basic model to create a new story attached to
task.assignee: User assigned to
task.followers: Collection of users following
task.stories: Collection of all stories attached to
task.projects: Collection of all projects to which
You can use your own copy of
Backbone by passing it as an option
asana = new Asana key : "deadbeef" Backbone : myBackbone