Tasks


GET /tasks

Query Parameters

Parameter Type Description
account Array | Integer Filter tasks by account.
assigned Integer Filter tasks by assigned user.
categories Array | Integer Filter tasks by categories assigned to the task.
collection Array | Integer Filter tasks by collection assigned to task.
complete Boolean Filter tasks by it's status complete flag.
date DateRange Filter tasks by it's due date
event Array | Integer Filters tasks by event.
join String Values to join to task resource.
search String Filter tasks by matching the task name or description.
season Array | Integer Filter tasks by season.
user Array | Integer Filter tasks by accounts assigned to user.

{primary} You can filter the tasks you're assocated with by passing me to the user parameter.

Example Requests

All Tasks assigned to account with id 1 and incomplete

https://example.trak.io/api/v1/tasks?account=1&complete=false

Example Response

The response will return an array of Task Models

{
    "success": true,
    "message": null,
    "data": {
        "data": [
            {...}
        ]
    }
}

GET /tasks/{task_id}

Example Requests

Task with ID 1 and it's account and status

https://example.trak.io/api/v1/tasks/1?with=account|status

Example Response

The response will return an object of Task Model

{
    "success": true,
    "message": null,
    "data": {
        ...
    }
}

POST /tasks

Query Parameters

Parameter Type Required Description
account_id Integer true The status of the task.
collection_id Integer true The collection of the task.
description String false Description of the task.
due_date Date false Due date of the task. Format: YYYY-MM-DD
name String true Name of the task.
quantity Integer false Quantity of task. Defaults to 1.
season_id Integer true The season of the task.
status_id Integer false The status of the task, defaults to collection default.

Example Requests

{
    "account_id": 1,
    "collection_id": 1,
    "description": null,
    "due_date": "2020-01-01",
    "name": "Example Task",
    "season_id": 1,
    "status_id": 1
}

Example Response

The response will return an object of Task Model

{
    "success": true,
    "message": "API_TASK_CREATED",
    "data": {
        ...
    }
}

PUT /tasks/{task_id}

Query Parameters

Parameter Type Required Description
account_id Integer true The status of the task.
collection_id Integer true The collection of the task.
description String false Description of the task.
due_date Date false Due date of the task. Format: YYYY-MM-DD
name String true Name of the task.
quantity Integer false Quantity of task. Defaults to 1.
season_id Integer true The season of the task.
status_id Integer true The status of the task.

Example Requests

Only parameters that are intended to be updated are required in the request. All parameters that are not being updated can be omitted.

{
    "due_date": "2020-01-01",
    "name": "Updated Task"
}

Example Response

The response will return an object of Task Model

{
    "success": true,
    "message": "API_TASK_UPDATED",
    "data": {
        ...
    }
}

DELETE /tasks/{task_id}

{danger} Deleting a task will also delete any comments or files attached to the task.

Example Response

The response will return an object of Task Model

{
    "success": true,
    "message": "API_TASK_DELETED",
    "data": {
        ...
    }
}