Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 173 lines (106 sloc) 4.672 kb
f341eece »
2012-05-21 port the rest of the docs over
1 Todo List Items
2 ===============
3
392a7a7f »
2014-02-06 Become Basecamp
4 For the full XML representation of todo items, [check out the data reference](https://github.com/basecamp/basecamp-classic-api/blob/master/sections/data_reference.md#todo_item).
cc33d5e3 »
2012-05-21 add links to data reference
5
f341eece »
2012-05-21 port the rest of the docs over
6 Get all items (for a list)
7 --------------------------
8
9 * `GET /todo_lists/#{todo_list_id}/todo_items.xml` returns all todo item records for a single todo list.
10
11 This is almost the same as the “Get list” action, except it does not return any information about the list itself. The items are returned in priority order, as defined by how they were ordered either in the web UI, or via the “Reorder items” action.
12
13 **Response:**
14
15 ``` xml
16 <todo-items type="array">
17 <todo-item>
18 ...
19 </todo-item>
20 ...
21 </todo-items>
22 ```
23
24
25 Get item
26 --------
27
28 * `GET /todo_items/#{id}.xml` returns a single todo item record, given its integer ID.
29
30 **Response:**
31
32 ``` xml
33 <todo-item>
34 ...
35 </todo-item>
36 ```
37
38
39 Complete item
40 -------------
41
42 * `PUT /todo_items/#{id}/complete.xml` marks the specified todo item as completed.
43
44 **Response:**
45
46 Returns HTTP status code 200 on success.
47
48
49 Uncomplete item
50 ---------------
51
52 * `PUT /todo_items/#{id}/uncomplete.xml` marks the specified todo as uncompleted.
53
54 If the specified todo item was previously marked as completed, this unmarks it, restoring it to an “uncompleted” state. If it was already in the uncompleted state, this call has no effect.
55
56 **Response:**
57
58 Returns HTTP status code 200 on success.
59
60
61 New item
62 --------
63
64 * `GET /todo_lists/#{todo_list_id}/todo_items/new.xml` returns a “blank” XML record that may be used as a template for creating a new todo item.
65
66 Just fill in the fields and submit the data as indicated by the custom X-Create-Action HTTP header.
67
68 **Response:**
69
70 ``` xml
71 <todo-item>
72 ...
73 </todo-item>
74 ```
75
76
77 Create item
78 -----------
79
80 * `POST /todo_lists/#{todo_list_id}/todo_items.xml` creates a new todo item record for the given list.
81
82 The new record begins its life in the `uncompleted` state. (See the “Complete” and “Uncomplete” actions.) It is added at the bottom of the given list. If a person is responsible for the item, give their id as the party_id value. If a company is responsible, prefix their company id with a ‘c’ and use that as the party_id value. If the item has a person as the responsible party, you can also use the `notify` key to indicate whether an email should be sent to that person to tell them about the assignment.
83
84 **Request:**
85
86 ``` xml
87 <todo-item>
88 <content>#{content}</content>
89
90 <!-- if the item has a due date (in the company time zone) -->
91 <due-at>#{due_at}</due-at>
92
93 <!-- if the item has a responsible party -->
94 <responsible-party>#{party_id}</responsible-party>
95 <notify type="boolean">#{true|false}</notify>
96 </todo-item>
97 ```
98
99 **Response:**
100
101 Returns HTTP status code 201 Created on success, with the Location header being set to the URL for the new item. (The new item’s integer ID may be extractd from that URL.)
102
103
104 Update item
105 -----------
106
107 * `PUT /todo_items/#{id}.xml` updates an existing todo item record with the given data.
108
109 See the “Create item” action for a full discussion of the meaning of the data fields.
110
111 **Request:**
112
113 ``` xml
114 <todo-item>
115 <content>#{content}</content>
116
117 <!-- if the item has a responsible party -->
118 <responsible-party>#{party_id}</responsible-party>
119 <notify type="boolean">#{true|false}</notify>
120 </todo-item>
121 ```
122
123 **Response:**
124
125 Returns HTTP status code 200 on success.
126
127
128 Edit item
129 ---------
130
131 * `GET /todo_items/#{id}/edit.xml` returns an XML record for the requested todo item, ready to be modified and submitted via the “Update item” action.
132
133 A custom HTTP header, `X-Update-Action`, is also given, indicating where and how the data may be submitted.
134
135 **Response:**
136
137 ``` xml
138 <todo-item>
139 ...
140 </todo-item>
141 ```
142
143
144 Destroy item
145 ------------
146
147 * `DELETE /todo_items/#{id}.xml` destroys the given todo item record.
148
149 **Response:**
150
151 Returns HTTP status code 200 on success.
152
153
154 Reorder items
155 -------------
156
157 * `POST /todo_lists/#{todo_list_id}/todo_items/reorder.xml` changes the ordering of the items for the given list.
158
159 Completed items cannot be reordered, and any items not specified will be sorted after the items explicitly given (allowing you to easily move a single item to the head of the list without having to specify the positions of all the other items). You may reparent items by putting items from one list into the ordering of items for a different list (though items cannot be reparented across project boundaries).
160
161 **Request:**
162
163 ``` xml
164 <todo-items type="array">
165 <todo-item><id>#{id}</id></todo-item>
166 ...
167 </todo-items>
168 ```
169
170 **Response:**
171
172 Returns HTTP status code 200 on success.
Something went wrong with that request. Please try again.