Skip to content

Dispatcher.API

Phips Peter edited this page Oct 22, 2014 · 6 revisions

Class: Dispatcher

Dispatcher

A HTTP wrapper for the Asana API

new Dispatcher(authKey, authValue)

Creates a dispatcher which will augment the parameters passed to request with the authKey: authValue mutation.

Parameters:
Name Type Description
authKey String

The key for request authentication

authValue String | Object

The value for request authentication

Source:

Members

<static> ROOT_URL :String

The root Url for the current version of the Asana API.

Type:
  • String
Source:

authKey :String

The key for the request options hash

Type:
  • String
Source:

authValue :String|Object

The value for the request options hash

Type:
  • String | Object
Source:

Methods

<static> url(path) → {String}

Creates an Asana API Url by concatenating the ROOT_URL with path provided.

Parameters:
Name Type Description
path String

The path

Source:
Returns:

The url

Type
String

delete(path) → {BPromise}

Dispatches a DELETE request to the Asana API.

Parameters:
Name Type Description
path String

The path of the API

Source:
Returns:

The response for the request

Type
BPromise

dispatch(params) → {BPromise}

Dispatches a request to the Asana API. The request parameters are passed to the request module.

Parameters:
Name Type Description
params Object

The params for request

Source:
Returns:

The response for the request

Type
BPromise

get(path, query) → {BPromise}

Dispatches a GET request to the Asana API.

Parameters:
Name Type Argument Description
path String

The path of the API

query Object <optional>

The query params

Source:
Returns:

The response for the request

Type
BPromise

post(path, data) → {BPromise}

Dispatches a POST request to the Asana API.

Parameters:
Name Type Description
path String

The path of the API

data Object

The data to be sent

Source:
Returns:

The response for the request

Type
BPromise

put(path, data) → {BPromise}

Dispatches a PUT request to the Asana API.

Parameters:
Name Type Description
path String

The path of the API

data Object

The data to be sent

Source:
Returns:

The response for the request

Type
BPromise

Generated with wicked.