TasksAPI

new TasksAPI(rest)

This class is used to interact with Tasks in TidyHQ.
Parameters:
NameTypeDescription
restRestThe rest instance to use for requests.

Methods

(async) createTask(contact_id, title, due_date, optionsopt) → {Promise.<TidyAPI_V1_Task>}

Create a new task.
Parameters:
NameTypeAttributesDefaultDescription
contact_idstringThe ID of the contact to assign the task to.
titlestringThe title of the task.
due_datestringThe due date of the task in ISO 8601 format.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
descriptionstring<optional>
The description of the task.
Returns:
- The new task.
Type: 
Promise.<TidyAPI_V1_Task>

(async) deleteTask(task_id, optionsopt) → {Promise.<TidyAPI_Response>}

Delete a task.
Parameters:
NameTypeAttributesDefaultDescription
task_idstringThe ID of the task.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- Success or failure.
Type: 
Promise.<TidyAPI_Response>

(async) getContactTasks(contact_id, optionsopt) → {Promise.<TidyAPI_V1_Tasks>}

Get a list of all tasks for a contact.
Parameters:
NameTypeAttributesDefaultDescription
contact_idstringThe ID of the contact.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
limitstring<optional>
The number of results to return.
offsetstring<optional>
The number of results to skip.
completedboolean<optional>
Return only completed tasks or not.
Returns:
- The list of tasks.
Type: 
Promise.<TidyAPI_V1_Tasks>

(async) getTask(task_id, optionsopt) → {Promise.<TidyAPI_V1_Task>}

Get a single task.
Parameters:
NameTypeAttributesDefaultDescription
task_idstringThe ID of the task.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The task.
Type: 
Promise.<TidyAPI_V1_Task>

(async) getTasks(optionsopt) → {Promise.<TidyAPI_V1_Tasks>}

Get a list of all tasks.
Parameters:
NameTypeAttributesDefaultDescription
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
limitstring<optional>
The number of results to return.
offsetstring<optional>
The number of results to skip.
completedboolean<optional>
Return only completed tasks or not.
Returns:
- The list of tasks.
Type: 
Promise.<TidyAPI_V1_Tasks>

(async) updateTask(task_id, optionsopt) → {Promise.<TidyAPI_V1_Task>}

Update a task.
Parameters:
NameTypeAttributesDescription
task_idstringThe ID of the task.
optionsobject<optional>
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
contact_idstring<optional>
The ID of the contact to assign the task to.
titlestring<optional>
The title of the task.
due_datestring<optional>
The due date of the task in ISO 8601 format.
descriptionstring<optional>
The description of the task.
completedboolean<optional>
Whether the task is completed or not.
Returns:
- The updated task.
Type: 
Promise.<TidyAPI_V1_Task>