-
Notifications
You must be signed in to change notification settings - Fork 0
API: Task Lists
Important: The task list is the container of the tasks. If you want to retrieve the tasks see the 'Tasks' page.
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".
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).
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.
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.
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.