1 Lazy Shopping List protocol
2 ===========================
7 Returns a JSON object with the following keys:
9 - `lists`: URI for the list of shopping lists available. Referred to as
15 Returns a JSON object with the following keys:
17 - `lists`: a list of objects with the following keys:
18 - `uri`: the list URI. Referred to as `/list/$list_id` below. The part after
19 the last `/` (`$list_id`) is an integer that is unique among all shopping
21 - `name`: list name as entered by users
22 - `lists_version`: a number that is incremented by 1 each time the list of
23 shopping lists changes. Changes include adding, removing and renaming a
24 shopping list, but not changes to individual shopping list items.
29 Returns a JSON object with the following keys:
31 - `items`: a list of shopping list item objects with keys:
32 - `uri`: the URI of the individual list item (refered to as
33 `/list/$list_id/$item_id` below. The part after the last `/` (`$list_id`)
34 is a positive integer that is unique amont the items in the shopping list.
35 - `description`: item description
36 - `done`: a boolean flag marking the item as done
37 - `version`: a number that is incremented by 1 each time the list items
38 change. Changes include adding, removing, renaming and marking a shopping
39 list item as done or pending.
40 - `lists_version`: the current version of the list of shopping lists
42 GET /list/$list_id/$item_id
43 ---------------------------
45 Returns a JSON object with the following keys:
47 - `description`: the description of the shopping list item
48 - `done`: a boolean flag marking the item as done
49 - `list_version`: the current version of the list
50 - `lists_version`: the current version of the list of shopping lists
55 Creates a new list. Request body is a JSON object with the following keys:
57 - `name`: list name as entered by the user
59 Response is a JSON object with the following keys:
61 - `uri`: the URI of the list (`/list/$list_id`)
62 - `version`: the initial version of the list
63 - `lists_version`: the version of the list of lists
68 Modifies a list. Request body is a JSON object with the following keys:
70 - `name`: new list name
71 - `version`: current list version as known by the client
73 Successful (HTTP status 200) response is a JSON object with the following keys:
75 - `version`: the curre version of the list
76 - `lists_version`: the new version of the list of lists
78 Possible error responses:
80 - HTTP status 409 (conflict): the list has been modified
81 Suggested client action is to fetch a fresh copy of the list data, present
82 the differences to the user and either cancel the request and keep the newly
83 fetched data as current, or re-submit the change using the fresh version
89 Deletes the list. No request body. Always succeeds, even if the list doesn't
90 exist server-side, in which case the `lists_version` isn't changed.
92 Returns JSON object with the following keys:
94 - `lists_version`: the new version of the list of lists.
99 Adds an item to the shopping list. Request body is a JSON object with the
102 - `description`: the description of the new shopping list item
103 - `done`: (boolean) the done state
105 Successful response is a JSON object with the following keys:
107 - `uri`: the URI of the newly added shopping list item
108 - `version`: version of the item
109 - `list_version`: version of the containing list
110 - `lists_version`: version of the list of lists
112 PUT /list/$list_id/$item_id
113 ---------------------------
115 Modifies a shopping list item. Request body is a JSON object with the following
118 - `description`: new item description
119 - `done`: (boolean) desired item state
120 - `version`: (required) the version of the item as known by the client
122 Successful response is a JSON object with the following keys:
124 - `version`: the new version of the item
125 - `list_version`: the current version of the list
126 - `lists_version`: the current version of the list of shopping lists
128 Possible error responses:
130 - HTTP status 409 (conflict): the item has been modified
131 Suggested client action is to fetch a fresh copy of the item data, present
132 the differences to the user and either cancel the request and keep the newly
133 fetched data as current, or re-submit the change using the fresh version