Skip to content
Dimitri Jorge edited this page May 14, 2013 · 3 revisions

Important: The task list is the container of the tasks. If you want to retrieve the tasks see the 'Tasks' page.

Show a task lists

Route: GET /api/v1/task_lists/:id

This will return informations about the task list :id.

Example:

curl -X GET \
   -H "Accept: application/json" \
   -d 'auth_token=sYcyvuHUopjT46iMhkU5' \
    http://localhost:3001/api/v1/task_lists/3

Will have the following output:

{
  "id": 3,
  "title": "bijour",
  "description": null,
  "family_id": 1,
  "author": {
    "id": 1,
    "avatar_url": "https://secure.gravatar.com/avatar/458641ed4b2725b16edbf0192ca0b2f2.png?d=mm&r=PG&s=40",
    "first_name": "Dimitri",
    "last_name": "Jorge",
    "nickname": "dimitri.jorge",
    "visible_name": "dimitri.jorge"
  },
  "tasks": {
    "total_tasks_count": 0,
    "finished_tasks_count": 0,
    "status": "empty"
  }
}

The value of the field status can be "empty", "open" or "finished".

List task lists

Route: GET /api/v1/task_lists

This will return an array containing all the task lists of your family.

Example:

curl -X GET \
   -H "Accept: application/json" \
   -d 'auth_token=sYcyvuHUopjT46iMhkU5' \
    http://localhost:3001/api/v1/task_lists

The output will be an array of task_lists (see the show section).

Create task list

Route: POST /api/v1/task_lists

You MUST send a title param with your query (at least 4 characters).

Example:

curl -X POST \
   -H "Accept: application/json" \
   -d 'auth_token=sYcyvuHUopjT46iMhkU5' \
   -d 'task_list[title]=A title&task_List[description]=lorem ipsum blah blah blah' \
    http://localhost:3001/api/v1/task_lists

See the show section for the output.

Update a task list

Route: PUT /api/v1/task_lists/:id

You can update the title or the description the task list identified by :id using this call.

Example:

curl -X PUT \
   -H "Accept: application/json" \
   -d 'auth_token=sYcyvuHUopjT46iMhkU5' \
   -d 'task_list[title]=A title&task_List[description]=lorem ipsum blah blah blah' \
    http://localhost:3001/api/v1/task_lists

See the show section for the output.

Delete a task list

Route: DELETE /api/v1/task_lists/:id

Note: Anyone in the family can delete a task list.

This WILL delete the task list identified by :id.

Example:

curl -X DELETE \
   -H "Accept: application/json" \
   -d 'auth_token=sYcyvuHUopjT46iMhkU5' \
    http://localhost:3001/api/v1/task_lists/22

The response will be empty with a 204 status code in case of success.