Trak Software Documentation logo

Tasks


GET /tasks

Query Parameters

Parameter Type Description
account Integer Filter tasks by account. Pass multiple ids seperated by | character.
assigned Integer Filter tasks by assigned user.
categories Integer Filter tasks by categories assigned to the task. Pass multiple ids seperated by | character.
collection 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 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 Integer Filter tasks by season.
user 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.

Joining Resources

Here is a list of available resources to join on tasks.

['account', 'assigned', 'author', 'categories', 'comments', 'events', 'files', 'season', 'status']

Example Requests

All Tasks assigned to account with id 1 and incomplete

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

Task with ID 1 and it's account and status

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

Example Response

{
    "success": true,
    "message": null,
    "data": {
        "current_page": 1,
        "data": [
            {
                "task_id": 1,
                "site_id": 1,
                "user_id": 1,
                "season_id": 1,
                "account_id": 1,
                "collection_id": 1,
                "status_id": 1,
                "inventory_id": null,
                "event_id": null,
                "assigned_id": 5,
                "name": "Example Task",
                "description": "<p>An example description.</p>",
                "due_date": null,
                "quantity": 1,
                "created_at": "2020-01-01 00:00:00",
                "updated_at": "2020-01-01 00:00:00",
                "account_name": "Example Account",
                "status_name": "Incomplete",
                "collection": {
                    "collection_id": 1,
                    "site_id": 1,
                    "user_id": 1,
                    "order": 1,
                    "name": "Assets",
                    "collaborative": 1,
                    "created_at": "2018-12-03 20:32:56",
                    "updated_at": "2018-12-03 21:51:13"
                },
                "account": {
                    "account_id": 1,
                    "site_id": 1,
                    "user_id": 1,
                    "status_id": 1,
                    "name": "Example Account",
                    "notifications": 1,
                    "logo": null,
                    "created_at": "2018-12-03 20:33:04",
                    "updated_at": "2018-12-03 20:33:04"
                },
                "season": {
                    "season_id": 1,
                    "site_id": 1,
                    "user_id": 1,
                    "name": "Default Season",
                    "active": 1,
                    "created_at": "2018-12-03 20:32:56",
                    "updated_at": "2018-12-07 20:24:52"
                },
                "status": {
                    "status_id": 1,
                    "site_id": 1,
                    "user_id": 1,
                    "collection_id": 1,
                    "name": "Incomplete",
                    "color": "#ff0000",
                    "default": 0,
                    "complete": 1,
                    "created_at": "2018-12-03 20:32:56",
                    "updated_at": "2018-12-03 20:32:56"
                },
                "assigned": {
                    "user_id": 5,
                    "site_id": 1,
                    "group_id": 5,
                    "first": "Trak",
                    "last": "Collaborator",
                    "email": "collaborator@example.com",
                    "avatar": null,
                    "terms": 1,
                    "active": 1,
                    "editor": 1,
                    "created_at": "2018-12-03 20:33:01",
                    "updated_at": "2019-02-09 17:09:00",
                    "login_at": "2019-02-09 17:09:00"
                }
            },
            ...
        ],
        "first_page_url": "https://example.trak.io/api/v1/tasks?page=1",
        "from": 1,
        "last_page": 67,
        "last_page_url": "https://example.trak.io/api/v1/tasks?page=67",
        "next_page_url": "https://example.trak.io/api/v1/tasks?page=2",
        "path": "https://sponsorship.trak.dev/api/v1/tasks",
        "per_page": "1",
        "prev_page_url": null,
        "to": 1,
        "total": 67
    }
}

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 true The status of the task.

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

{
    "success": true,
    "message": "API_TASK_CREATED",
    "data": {
        "site_id": 1,
        "user_id": 1,
        "season_id": 1,
        "account_id": 1,
        "collection_id": 1,
        "status_id": 1,
        "inventory_id": null,
        "event_id": null,
        "assigned_id": null,
        "name": "Example Task",
        "description": null,
        "due_date": "2020-01-01 00:00:00",
        "quantity": 1,
        "task_id": 1
    }
}

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

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

Example Response

{
    "success": true,
    "message": "API_TASK_UPDATED",
    "data": {
        "task_id": 1,
        "site_id": 1,
        "user_id": 1,
        "season_id": 1,
        "account_id": 1,
        "collection_id": 1,
        "status_id": 1,
        "inventory_id": null,
        "event_id": null,
        "assigned_id": null,
        "name": "Updated Task",
        "description": null,
        "due_date": "2020-01-01 00:00:00",
        "quantity": 1
    }
}

DELETE /tasks/{task_id}

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

Example Response

{
    "success": true,
    "message": "API_TASK_DELETED",
    "data": []
}