Class: Tasks

Tasks(client) → {void}

Simple manager for interacting with all 'Tasks' endpoints and actions.

Constructor

new Tasks(client) → {void}

Parameters:
Name Type Description
client BoxClient The Box API Client that is responsible for making calls to the API
Source:
Returns:
Type
void

Members

(readonly) resolutionStates :TaskResolutionState

Enum of valid task resolution states
Type:
Source:

Methods

assignByEmail(taskID, email, callbackopt) → {Promise.<Object>}

Assign a task to a specific user by email address API Endpoint: '/task_assignments' Method: POST
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task to assign
email string The email address of the user to assign the task to
callback function <optional>
Passed the task assignment if successful, error otherwise
Source:
Returns:
A promise resolving to the new assignment object
Type
Promise.<Object>

assignByEmail(taskID, email, callbackopt) → {Promise.<Object>}

Assign a task to a specific user by email address API Endpoint: '/task_assignments' Method: POST
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task to assign
email string The email address of the user to assign the task to
callback function <optional>
Passed the task assignment if successful, error otherwise
Source:
Returns:
A promise resolving to the new assignment object
Type
Promise.<Object>

assignByUserID(taskID, userID, callbackopt) → {Promise.<Object>}

Assign a task to a specific user by ID API Endpoint: '/task_assignments' Method: POST
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task to assign
userID string The ID of the user to assign the task to
callback function <optional>
Passed the task assignment if successful, error otherwise
Source:
Returns:
A promise resolving to the new assignment object
Type
Promise.<Object>

assignByUserID(taskID, userID, callbackopt) → {Promise.<Object>}

Assign a task to a specific user by ID API Endpoint: '/task_assignments' Method: POST
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task to assign
userID string The ID of the user to assign the task to
callback function <optional>
Passed the task assignment if successful, error otherwise
Source:
Returns:
A promise resolving to the new assignment object
Type
Promise.<Object>

create(fileID, optionsopt, callbackopt) → {Promise.<Object>}

Used to create a single task for single user on a single file. API Endpoint: '/tasks' Method: POST
Parameters:
Name Type Attributes Description
fileID string The ID of the item this task is for
options Object <optional>
Additional parameters
Properties
Name Type Attributes Description
message string <optional>
An optional message to include with the task
due_at string <optional>
The day at which this task is due
callback function <optional>
Passed the new task information if it was acquired successfully, error otherwise
Source:
Returns:
A promise resolving to the created task object
Type
Promise.<Object>

create(fileID, optionsopt, callbackopt) → {Promise.<Object>}

Used to create a single task for single user on a single file. API Endpoint: '/tasks' Method: POST
Parameters:
Name Type Attributes Description
fileID string The ID of the item this task is for
options Object <optional>
Additional parameters
Properties
Name Type Attributes Description
message string <optional>
An optional message to include with the task
due_at string <optional>
The day at which this task is due
callback function <optional>
Passed the new task information if it was acquired successfully, error otherwise
Source:
Returns:
A promise resolving to the created task object
Type
Promise.<Object>

delete(taskID, callbackopt) → {Promise.<void>}

Permanently deletes a specific task. API Endpoint: '/tasks/:taskID' Method: DELETE
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task being deleted
callback function <optional>
Empty body passed if successful, error otherwise
Source:
Returns:
A promise resolving to nothing
Type
Promise.<void>

delete(taskID, callbackopt) → {Promise.<void>}

Permanently deletes a specific task. API Endpoint: '/tasks/:taskID' Method: DELETE
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task being deleted
callback function <optional>
Empty body passed if successful, error otherwise
Source:
Returns:
A promise resolving to nothing
Type
Promise.<void>

deleteAssignment(assignmentID, callbackopt) → {Promise.<void>}

Delete a task assignment. This unassigns a user from the related task. API Endpoint: '/task_assignments/:assignmentID' Method: DELETE
Parameters:
Name Type Attributes Description
assignmentID string The Box ID of the task assignment to delete
callback function <optional>
Passed nothing if successful, error otherwise
Source:
Returns:
A promise resolving to nothing
Type
Promise.<void>

deleteAssignment(assignmentID, callbackopt) → {Promise.<void>}

Delete a task assignment. This unassigns a user from the related task. API Endpoint: '/task_assignments/:assignmentID' Method: DELETE
Parameters:
Name Type Attributes Description
assignmentID string The Box ID of the task assignment to delete
callback function <optional>
Passed nothing if successful, error otherwise
Source:
Returns:
A promise resolving to nothing
Type
Promise.<void>

get(taskID, optionsopt, callbackopt) → {Promise.<Object>}

Fetches a specific task. API Endpoint: '/tasks/:taskID' Method: GET
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task being requested
options Object <optional>
Additional options for the request. Can be left null in most cases.
callback function <optional>
Passed the task information if it was acquired successfully, error otherwise
Source:
Returns:
A promise resolving to the task object
Type
Promise.<Object>

get(taskID, optionsopt, callbackopt) → {Promise.<Object>}

Fetches a specific task. API Endpoint: '/tasks/:taskID' Method: GET
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task being requested
options Object <optional>
Additional options for the request. Can be left null in most cases.
callback function <optional>
Passed the task information if it was acquired successfully, error otherwise
Source:
Returns:
A promise resolving to the task object
Type
Promise.<Object>

getAssignment(assignmentID, optionsopt, callbackopt) → {Promise.<Object>}

Get a specific task assignment API Endpoint: '/task_assignments/:assignmentID' Method: GET
Parameters:
Name Type Attributes Description
assignmentID string The Box ID of the task assignment to retrieve
options Object <optional>
Additional parameters, can be left null in most cases
callback function <optional>
Passed the task assignment if successful, error otherwise
Source:
Returns:
A promise resolving to the assignment object
Type
Promise.<Object>

getAssignment(assignmentID, optionsopt, callbackopt) → {Promise.<Object>}

Get a specific task assignment API Endpoint: '/task_assignments/:assignmentID' Method: GET
Parameters:
Name Type Attributes Description
assignmentID string The Box ID of the task assignment to retrieve
options Object <optional>
Additional parameters, can be left null in most cases
callback function <optional>
Passed the task assignment if successful, error otherwise
Source:
Returns:
A promise resolving to the assignment object
Type
Promise.<Object>

getAssignments(taskID, optionsopt, callbackopt) → {Promise.<Object>}

Get a list of assignments for a given task API Endpoint: '/tasks/:taskID/assignments' Method: GET
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task to get assignments for
options Object <optional>
Additional parameters, can be left null in most cases
callback function <optional>
Passed the list of assignments if successful, error otherwise
Source:
Returns:
A promise resolving to the collection of assignment objects
Type
Promise.<Object>

getAssignments(taskID, optionsopt, callbackopt) → {Promise.<Object>}

Get a list of assignments for a given task API Endpoint: '/tasks/:taskID/assignments' Method: GET
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task to get assignments for
options Object <optional>
Additional parameters, can be left null in most cases
callback function <optional>
Passed the list of assignments if successful, error otherwise
Source:
Returns:
A promise resolving to the collection of assignment objects
Type
Promise.<Object>

update(taskID, updates, callbackopt) → {Promise.<Object>}

Updates a specific task. API Endpoint: '/tasks/:taskID' Method: PUT
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task being updated
updates Object Fields of the task object to update
Properties
Name Type Attributes Description
message string <optional>
An optional message to include with the task
due_at string <optional>
The day at which this task is due
callback function <optional>
Passed the updated task information if it was acquired successfully, error otherwise
Source:
Returns:
A promise resolving to the updated task object
Type
Promise.<Object>

update(taskID, updates, callbackopt) → {Promise.<Object>}

Updates a specific task. API Endpoint: '/tasks/:taskID' Method: PUT
Parameters:
Name Type Attributes Description
taskID string The Box ID of the task being updated
updates Object Fields of the task object to update
Properties
Name Type Attributes Description
message string <optional>
An optional message to include with the task
due_at string <optional>
The day at which this task is due
callback function <optional>
Passed the updated task information if it was acquired successfully, error otherwise
Source:
Returns:
A promise resolving to the updated task object
Type
Promise.<Object>

updateAssignment(assignmentID, options, callbackopt) → {Promise.<Object>}

Update a task assignment. This is used to resolve or complete a task. API Endpoint: '/task_assignments/:assignmentID' Method: PUT
Parameters:
Name Type Attributes Description
assignmentID string The Box ID of the task assignment to update
options Object The fields of the assignment to update
Properties
Name Type Attributes Description
message string <optional>
A message from the assignee about this task
resolution_state TaskResolutionState <optional>
Resolution of the task
callback function <optional>
Passed the updated task assignment if successful, error otherwise
Source:
Returns:
A promise resolving to the updated assignment object
Type
Promise.<Object>

updateAssignment(assignmentID, options, callbackopt) → {Promise.<Object>}

Update a task assignment. This is used to resolve or complete a task. API Endpoint: '/task_assignments/:assignmentID' Method: PUT
Parameters:
Name Type Attributes Description
assignmentID string The Box ID of the task assignment to update
options Object The fields of the assignment to update
Properties
Name Type Attributes Description
message string <optional>
A message from the assignee about this task
resolution_state TaskResolutionState <optional>
Resolution of the task
callback function <optional>
Passed the updated task assignment if successful, error otherwise
Source:
Returns:
A promise resolving to the updated assignment object
Type
Promise.<Object>