-
Notifications
You must be signed in to change notification settings - Fork 79
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 |
-
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.
-
<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 apiKeyString 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 tokenString The Asana OAuth token of the user
The instantiated client
- Type
- Client