new TasksAPI(rest)
This class is used to interact with Tasks in TidyHQ.
Parameters:
Name | Type | Description |
---|---|---|
rest | Rest | The rest instance to use for requests. |
- Source
Methods
(async) createTask(contact_id, title, due_date, optionsopt) → {Promise.<TidyAPI_V1_Task>}
Create a new task.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
contact_id | string | The ID of the contact to assign the task to. | ||||||||||||||
title | string | The title of the task. | ||||||||||||||
due_date | string | The due date of the task in ISO 8601 format. | ||||||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The new task.
- Type:
- Promise.<TidyAPI_V1_Task>
(async) deleteTask(task_id, optionsopt) → {Promise.<TidyAPI_Response>}
Delete a task.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
task_id | string | The ID of the task. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
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:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
contact_id | string | The ID of the contact. | ||||||||||||||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The list of tasks.
- Type:
- Promise.<TidyAPI_V1_Tasks>
(async) getTask(task_id, optionsopt) → {Promise.<TidyAPI_V1_Task>}
Get a single task.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
task_id | string | The ID of the task. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The task.
- Type:
- Promise.<TidyAPI_V1_Task>
(async) getTasks(optionsopt) → {Promise.<TidyAPI_V1_Tasks>}
Get a list of all tasks.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The list of tasks.
- Type:
- Promise.<TidyAPI_V1_Tasks>
(async) updateTask(task_id, optionsopt) → {Promise.<TidyAPI_V1_Task>}
Update a task.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
task_id | string | The ID of the task. | |||||||||||||||||||||||||||||
options | object | <optional> | Properties
|
- Source
Returns:
- The updated task.
- Type:
- Promise.<TidyAPI_V1_Task>