-
Notifications
You must be signed in to change notification settings - Fork 74
Client.API
A wrapper for the Asana API which is authenticated for one user
Constructs a Client with instances of all the resources using the dispatcher. It also keeps a reference to the dispatcher so that way the end user can have access to it.
Name | Type | Description |
---|---|---|
dispatcher |
Dispatcher | The request dispatcher to use |
-
attachments :Attachments
-
An instance of the Attachments resource.
-
dispatcher :Dispatcher
-
The internal dispatcher. This is mostly used by the resources but provided for custom requests to the API or API features that have not yet been added to the client.
-
projects :Projects
-
An instance of the Projects resource.
-
stories :Stories
-
An instance of the Stories resource.
-
tags :Tags
-
An instance of the Tags resource.
-
tasks :Tasks
-
An instance of the Tasks resource.
-
teams :Teams
-
An instance of the Teams resource.
-
users :Users
-
An instance of the Users resource.
-
workspaces :Workspaces
-
An instance of the Workspaces resource.
-
<static> basicAuth(apiKey) → {Client}
-
Creates a Client for a user using that user's API Key and then authenticates through HTTP Basic Authentication. This is probably the easier method for command line scripts or bot like integrations. Handling "real" users should be preferably done with OAuth.
Name Type Description apiKey
String The Asana Api Key of the user
The instantiated client
- Type
- Client
-
<static> oauth(token) → {Client}
-
Creates a Client for the user using that user's OAuth token that is granted to the application. This library does not support handling the OAuth flow but libraries like passport-asana or others than handle that flow are excellent options.
Name Type Description token
String The Asana OAuth token of the user
The instantiated client
- Type
- Client