Todo Items

Todo Items are not part of the tree item hierarchy and are private to a workspace user.

Retrieving Todo Items

Example 1: Get todo items list

Get all todo items (for the authenticated user) - Open todo items are listed first in priority order followed by completed todo items in chronological order, most recent first.

% curl https://app.liquidplanner.com/api/v1/workspaces/:id/todo_items
[
  {
    "title": "New todo 1",
    "completed": null,
    "position": 0,
    "is_done": false,
    "type": "TodoItem",
    "id": 358
  },
  {
    "title": "This to-do list item has been marked done!",
    "completed": "2015-08-24T21:56:47+00:00",
    "position": null,
    "is_done": true,
    "type": "TodoItem",
    "id": 350
  }
]

Example 2: Get a todo item

Returns a single todo Item specified by the ID provided

% curl https://app.liquidplanner.com/api/v1/workspaces/:id/todo_items/:todo_item_id
{
  "title": "This is your private to-do list! Try adding a new item.",
  "completed": null,
  "position": 0,
  "is_done": false,
  "type": "TodoItem",
  "id": 351
}

Creating and Updating Todo Items

Example 1: Create a todo item

% curl -X POST https://app.liquidplanner.com/api/v1/workspaces/:id/todo_items -d '{"todo_item": {"title":"New todo 1"}}'
{
"title": "New todo 1",
"completed": null,
"position": 0,
"is_done": false,
"type": "TodoItem",
"id": 358
}

Example 2: Update todo item’s name

Update an existing todo item

% curl -X PUT https://app.liquidplanner.com/api/v1/workspaces/:id/todo_items/:todo_item_id -d '{"todo_item": {"title":"Updated sample todo"}}'
{
"title": "Updated sample todo",
"completed": null,
"position": 0,
"is_done": false,
"type": "TodoItem",
"id": 351
}

Example 3: Reorder todo items

Reorder the list of open todo items, expects a full set of open todo item IDs and returns the list of items

% curl -X PUT https://app.liquidplanner.com/api/v1/workspaces/:id/todo_items/reorder -d '{"todo_item_ids": [351, 358]}'
[
  {
    "title": "Updated sample todo",
    "completed": null,
    "position": 0,
    "is_done": false,
    "type": "TodoItem",
    "id": 351
  },
  {
    "title": "New todo 1",
    "completed": null,
    "position": 1,
    "is_done": false,
    "type": "TodoItem",
    "id": 358
  },
  {
    "title": "This to-do list item has been marked done!",
    "completed": "2015-08-24T21:56:47+00:00",
    "position": null,
    "is_done": true,
    "type": "TodoItem",
    "id": 350
  }
]

Example 4: Mark todo item done

Use update and set the is_done attribute to true to mark an item done

% curl -X PUT https://app.liquidplanner.com/api/v1/workspaces/:id/todo_items/:todo_item_id -d '{"todo_item": {"is_done":true}}'
{
  "title": "Updated sample todo",
  "completed": "2015-08-25T16:48:32+00:00",
  "position": null,
  "is_done": true,
  "type": "TodoItem",
  "id": 351
}

Example 5: Mark todo item undone

Use update and set the is_done attribute to false to mark and item undone

% curl -X PUT https://app.liquidplanner.com/api/v1/workspaces/:id/todo_items/:todo_item_id -d '{"todo_item": {"is_done":false}}'
{
  "title": "Updated sample todo",
  "completed": null,
  "position": 0,
  "is_done": false,
  "type": "TodoItem",
  "id": 351
}

Example 6: Convert todo item to task

Creates a task with the same name as the todo item, deletes the todo item, and returns the new task

% curl -X POST https://app.liquidplanner.com/api/v1/workspaces/:id/todo_items/:todo_item_id/convert_to_task
{
  "activity_id": 1057,
  "work": 0,
  "alerts": [],
  "project_id": null,
  "client_id": null,
  "client_name": null,
  "created_at": "2015-08-25T16:49:19+00:00",
  "created_by": 2,
  "custom_field_values": {},
…
}

Deleting Todo Items

% curl -X DELETE https://app.liquidplanner.com/api/v1/workspaces/:id/todo_items/358
{
  "title": "New todo 1",
  "completed": null,
  "position": 0,
  "is_done": false,
  "type": "TodoItem",
  "id": 358
}