]> git.datanom.net - caldav.git/blame - TODO
Add TODO
[caldav.git] / TODO
CommitLineData
b1364d61
MR
1http://sabre.io/dav/building-a-caldav-client/
20. Discovery
3PROPFIND / HTTP/1.1
4Depth: 0
5Prefer: return-minimal
6Content-Type: application/xml; charset=utf-8
7
8<d:propfind xmlns:d="DAV:">
9 <d:prop>
10 <d:current-user-principal />
11 </d:prop>
12</d:propfind>
13
14Success:
15HTTP/1.1 207 Multi-status
16Content-Type: application/xml; charset=utf-8
17
18<d:multistatus xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
19 <d:response>
20 <d:href>/</d:href>
21 <d:propstat>
22 <d:prop>
23 <d:current-user-principal>
24 <d:href>/principals/users/johndoe/</d:href>
25 </d:current-user-principal>
26 </d:prop>
27 <d:status>HTTP/1.1 200 OK</d:status>
28 </d:propstat>
29 </d:response>
30</d:multistatus>
31
32Get calendar home:
33PROPFIND /principals/users/johndoe/ HTTP/1.1
34Depth: 0
35Prefer: return-minimal
36Content-Type: application/xml; charset=utf-8
37
38<d:propfind xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
39 <d:prop>
40 <c:calendar-home-set />
41 </d:prop>
42</d:propfind>
43
44Success:
45HTTP/1.1 207 Multi-status
46Content-Type: application/xml; charset=utf-8
47
48<d:multistatus xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
49 <d:response>
50 <d:href>/principals/users/johndoe/</d:href>
51 <d:propstat>
52 <d:prop>
53 <c:calendar-home-set>
54 <d:href>/calendars/johndoe/</d:href>
55 </c:calendar-home-set>
56 </d:prop>
57 <d:status>HTTP/1.1 200 OK</d:status>
58 </d:propstat>
59 </d:response>
60</d:multistatus>
61
62Get all calendars:
63PROPFIND /calendars/johndoe/ HTTP/1.1
64Depth: 1
65Prefer: return-minimal
66Content-Type: application/xml; charset=utf-8
67
68<d:propfind xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/" xmlns:c="urn:ietf:params:xml:ns:caldav">
69 <d:prop>
70 <d:resourcetype />
71 <d:displayname />
72 <cs:getctag />
73 <c:supported-calendar-component-set />
74 </d:prop>
75</d:propfind>
76
77Success:
78HTTP/1.1 207 Multi-status
79Content-Type: application/xml; charset=utf-8
80
81<d:multistatus xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/" xmlns:c="urn:ietf:params:xml:ns:caldav">
82 <d:response>
83 <d:href>/calendars/johndoe/</d:href>
84 <d:propstat>
85 <d:prop>
86 <d:resourcetype>
87 <d:collection/>
88 </d:resourcetype>
89 </d:prop>
90 <d:status>HTTP/1.1 200 OK</d:status>
91 </d:propstat>
92 </d:response>
93 <d:response>
94 <d:href>/calendars/johndoe/home/</d:href>
95 <d:propstat>
96 <d:prop>
97 <d:resourcetype>
98 <d:collection/>
99 <c:calendar/>
100 </d:resourcetype>
101 <d:displayname>Home calendar</d:displayname>
102 <cs:getctag>3145</cs:getctag>
103 <c:supported-calendar-component-set>
104 <c:comp name="VEVENT" />
105 </c:supported-calendar-component-set>
106 </d:prop>
107 <d:status>HTTP/1.1 200 OK</d:status>
108 </d:propstat>
109 </d:response>
110 <d:response>
111 <d:href>/calendars/johndoe/tasks/</d:href>
112 <d:propstat>
113 <d:prop>
114 <d:resourcetype>
115 <d:collection/>
116 <c:calendar/>
117 </d:resourcetype>
118 <d:displayname>My TODO list</d:displayname>
119 <cs:getctag>3345</cs:getctag>
120 <c:supported-calendar-component-set>
121 <c:comp name="VTODO" />
122 </c:supported-calendar-component-set>
123 </d:prop>
124 <d:status>HTTP/1.1 200 OK</d:status>
125 </d:propstat>
126 </d:response>
127</d:multistatus>
128
1291. Get display name and ctag
130PROPFIND /calendars/johndoe/home/ HTTP/1.1
131Depth: 0
132Prefer: return-minimal
133Content-Type: application/xml; charset=utf-8
134
135<d:propfind xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
136 <d:prop>
137 <d:displayname />
138 <cs:getctag />
139 </d:prop>
140</d:propfind>
141
142Success:
143HTTP/1.1 207 Multi-status
144Content-Type: application/xml; charset=utf-8
145
146<d:multistatus xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
147 <d:response>
148 <d:href>/calendars/johndoe/home/</d:href>
149 <d:propstat>
150 <d:prop>
151 <d:displayname>Home calendar</d:displayname>
152 <cs:getctag>3145</cs:getctag>
153 </d:prop>
154 <d:status>HTTP/1.1 200 OK</d:status>
155 </d:propstat>
156 </d:response>
157</d:multistatus>
158
159Failure:
160HTTP/1.1 207 Multi-status
161Content-Type: application/xml; charset=utf-8
162
163<d:multistatus xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
164 <d:response>
165 <d:href>/calendars/johndoe/home/</d:href>
166 <d:propstat>
167 <d:prop>
168 <d:displayname />
169 <cs:getctag />
170 </d:prop>
171 <d:status>HTTP/1.1 403 Forbidden</d:status>
172 </d:propstat>
173 </d:response>
174</d:multistatus>
175
1762. Save display name and ctag (if ctag changes the calendar has changes)
177
1783. Download objects
179REPORT /calendars/johndoe/home/ HTTP/1.1
180Depth: 1
181Prefer: return-minimal
182Content-Type: application/xml; charset=utf-8
183
184<c:calendar-query xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
185 <d:prop>
186 <d:getetag />
187 <c:calendar-data />
188 </d:prop>
189 <c:filter>
190 <c:comp-filter name="VCALENDAR" />
191 </c:filter>
192</c:calendar-query>
193
194Success:
195HTTP/1.1 207 Multi-status
196Content-Type: application/xml; charset=utf-8
197
198<d:multistatus xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
199 <d:response>
200 <d:href>/calendars/johndoe/home/132456762153245.ics</d:href>
201 <d:propstat>
202 <d:prop>
203 <d:getetag>"2134-314"</d:getetag>
204 <c:calendar-data>BEGIN:VCALENDAR
205 VERSION:2.0
206 CALSCALE:GREGORIAN
207 BEGIN:VTODO
208 UID:132456762153245
209 SUMMARY:Do the dishes
210 DUE:20121028T115600Z
211 END:VTODO
212 END:VCALENDAR
213 </c:calendar-data>
214 </d:prop>
215 <d:status>HTTP/1.1 200 OK</d:status>
216 </d:propstat>
217 </d:response>
218 <d:response>
219 <d:href>/calendars/johndoe/home/132456-34365.ics</d:href>
220 <d:propstat>
221 <d:prop>
222 <d:getetag>"5467-323"</d:getetag>
223 <c:calendar-data>BEGIN:VCALENDAR
224 VERSION:2.0
225 CALSCALE:GREGORIAN
226 BEGIN:VEVENT
227 UID:132456-34365
228 SUMMARY:Weekly meeting
229 DTSTART:20120101T120000
230 DURATION:PT1H
231 RRULE:FREQ=WEEKLY
232 END:VEVENT
233 END:VCALENDAR
234 </c:calendar-data>
235 </d:prop>
236 <d:status>HTTP/1.1 200 OK</d:status>
237 </d:propstat>
238 </d:response>
239</d:multistatus>
240
241For each object get:
242- Calendar data
243- url
244- etag
245
2464. Check for changes
247- Fetch ctag -> see 1.
248- If ctag is changes fetch all etags
249REPORT /calendars/johndoe/home/ HTTP/1.1
250Depth: 1
251Prefer: return-minimal
252Content-Type: application/xml; charset=utf-8
253
254<c:calendar-query xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
255 <d:prop>
256 <d:getetag />
257 </d:prop>
258 <c:filter>
259 <c:comp-filter name="VCALENDAR" />
260 </c:filter>
261</c:calendar-query>
262
263Success:
264HTTP/1.1 207 Multi-status
265Content-Type: application/xml; charset=utf-8
266
267<d:multistatus xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
268 <d:response>
269 <d:href>/calendars/johndoe/home/132456762153245.ics</d:href>
270 <d:propstat>
271 <d:prop>
272 <d:getetag>"xxxx-xxx"</d:getetag>
273 </d:prop>
274 <d:status>HTTP/1.1 200 OK</d:status>
275 </d:propstat>
276 </d:response>
277 <d:response>
278 <d:href>/calendars/johndoe/home/fancy-caldav-client-1234253678.ics</d:href>
279 <d:propstat>
280 <d:prop>
281 <d:getetag>"5-12"</d:getetag>
282 </d:prop>
283 <d:status>HTTP/1.1 200 OK</d:status>
284 </d:propstat>
285 </d:response>
286</d:multistatus>
287
288Compare local url's to request:
289 if match compare etag. if etag compares continue else update.
290 delete each local url not found
291 fetch every url not found local
292
293update/fetch:
294REPORT /calendars/johndoe/home/ HTTP/1.1
295Depth: 1
296Prefer: return-minimal
297Content-Type: application/xml; charset=utf-8
298
299<c:calendar-multiget xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
300 <d:prop>
301 <d:getetag />
302 <c:calendar-data />
303 </d:prop>
304 <d:href>/calendars/johndoe/home/132456762153245.ics</d:href>
305 <d:href>/calendars/johndoe/home/fancy-caldav-client-1234253678.ics</d:href>
306</c:calendar-multiget>
307
3085. Updating objects
309If-Match contains etag to update and You must not change the UID of the original object
310PUT /calendars/johndoe/home/132456762153245.ics HTTP/1.1
311Content-Type: text/calendar; charset=utf-8
312If-Match: "2134-314"
313
314BEGIN:VCALENDAR
315....
316END:VCALENDAR
317
318Success:
319HTTP/1.1 204 No Content
320ETag: "2134-315"
321
322If no etag is returned make an immediate GET to get etag
323
3246. Create an object
325PUT /calendars/johndoe/home/somerandomstring.ics HTTP/1.1
326Content-Type: text/calendar; charset=utf-8
327
328BEGIN:VCALENDAR
329....
330END:VCALENDAR
331
332Success:
333HTTP/1.1 201 Created
334ETag: "21345-324"
335
3367. Deleting an object
337DELETE /calendars/johndoe/home/132456762153245.ics HTTP/1.1
338If-Match: "2134-314"
339
This page took 0.077558 seconds and 6 git commands to generate.