1
2
3
4
5
6
7Internet Engineering Task Force (IETF) C. Daboo
8Request for Comments: 6352 Apple
9Category: Standards Track August 2011
10ISSN: 2070-1721
11
12
13 CardDAV: vCard Extensions to
14 Web Distributed Authoring and Versioning (WebDAV)
15
16Abstract
17
18 This document defines extensions to the Web Distributed Authoring and
19 Versioning (WebDAV) protocol to specify a standard way of accessing,
20 managing, and sharing contact information based on the vCard format.
21
22Status of This Memo
23
24 This is an Internet Standards Track document.
25
26 This document is a product of the Internet Engineering Task Force
27 (IETF). It represents the consensus of the IETF community. It has
28 received public review and has been approved for publication by the
29 Internet Engineering Steering Group (IESG). Further information on
30 Internet Standards is available in Section 2 of RFC 5741.
31
32 Information about the current status of this document, any errata,
33 and how to provide feedback on it may be obtained at
34 http://www.rfc-editor.org/info/rfc6352.
35
36Copyright Notice
37
38 Copyright (c) 2011 IETF Trust and the persons identified as the
39 document authors. All rights reserved.
40
41 This document is subject to BCP 78 and the IETF Trust's Legal
42 Provisions Relating to IETF Documents
43 (http://trustee.ietf.org/license-info) in effect on the date of
44 publication of this document. Please review these documents
45 carefully, as they describe your rights and restrictions with respect
46 to this document. Code Components extracted from this document must
47 include Simplified BSD License text as described in Section 4.e of
48 the Trust Legal Provisions and are provided without warranty as
49 described in the Simplified BSD License.
50
51 This document may contain material from IETF Documents or IETF
52 Contributions published or made publicly available before November
53 10, 2008. The person(s) controlling the copyright in some of this
54 material may not have granted the IETF Trust the right to allow
55
56
57
58Daboo Standards Track [Page 1]
59
60RFC 6352 CardDAV August 2011
61
62
63 modifications of such material outside the IETF Standards Process.
64 Without obtaining an adequate license from the person(s) controlling
65 the copyright in such materials, this document may not be modified
66 outside the IETF Standards Process, and derivative works of it may
67 not be created outside the IETF Standards Process, except to format
68 it for publication as an RFC or to translate it into languages other
69 than English.
70
71Table of Contents
72
73 1. Introduction and Overview . . . . . . . . . . . . . . . . . . 4
74 2. Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 5
75 3. Requirements Overview . . . . . . . . . . . . . . . . . . . . 6
76 4. Address Book Data Model . . . . . . . . . . . . . . . . . . . 7
77 4.1. Address Book Server . . . . . . . . . . . . . . . . . . . 7
78 5. Address Book Resources . . . . . . . . . . . . . . . . . . . . 7
79 5.1. Address Object Resources . . . . . . . . . . . . . . . . . 7
80 5.1.1. Data Type Conversion . . . . . . . . . . . . . . . . . 8
81 5.1.1.1. Additional Precondition for GET . . . . . . . . . 8
82 5.2. Address Book Collections . . . . . . . . . . . . . . . . . 9
83 6. Address Book Feature . . . . . . . . . . . . . . . . . . . . . 10
84 6.1. Address Book Support . . . . . . . . . . . . . . . . . . . 10
85 6.1.1. Example: Using OPTIONS for the Discovery of
86 Support for CardDAV . . . . . . . . . . . . . . . . . 10
87 6.2. Address Book Properties . . . . . . . . . . . . . . . . . 10
88 6.2.1. CARDDAV:addressbook-description Property . . . . . . . 10
89 6.2.2. CARDDAV:supported-address-data Property . . . . . . . 11
90 6.2.3. CARDDAV:max-resource-size Property . . . . . . . . . . 12
91 6.3. Creating Resources . . . . . . . . . . . . . . . . . . . . 13
92 6.3.1. Extended MKCOL Method . . . . . . . . . . . . . . . . 13
93 6.3.1.1. Example - Successful MKCOL Request . . . . . . . . 14
94 6.3.2. Creating Address Object Resources . . . . . . . . . . 15
95 6.3.2.1. Additional Preconditions for PUT, COPY, and
96 MOVE . . . . . . . . . . . . . . . . . . . . . . . 16
97 6.3.2.2. Non-Standard vCard Properties and Parameters . . . 17
98 6.3.2.3. Address Object Resource Entity Tag . . . . . . . . 18
99 7. Address Book Access Control . . . . . . . . . . . . . . . . . 18
100 7.1. Additional Principal Properties . . . . . . . . . . . . . 18
101 7.1.1. CARDDAV:addressbook-home-set Property . . . . . . . . 19
102 7.1.2. CARDDAV:principal-address Property . . . . . . . . . . 19
103 8. Address Book Reports . . . . . . . . . . . . . . . . . . . . . 20
104 8.1. REPORT Method . . . . . . . . . . . . . . . . . . . . . . 20
105 8.2. Ordinary Collections . . . . . . . . . . . . . . . . . . . 21
106 8.3. Searching Text: Collations . . . . . . . . . . . . . . . . 21
107 8.3.1. CARDDAV:supported-collation-set Property . . . . . . . 22
108 8.4. Partial Retrieval . . . . . . . . . . . . . . . . . . . . 23
109 8.5. Non-Standard Properties and Parameters . . . . . . . . . . 23
110
111
112
113
114Daboo Standards Track [Page 2]
115
116RFC 6352 CardDAV August 2011
117
118
119 8.6. CARDDAV:addressbook-query Report . . . . . . . . . . . . . 23
120 8.6.1. Limiting Results . . . . . . . . . . . . . . . . . . . 25
121 8.6.2. Truncation of Results . . . . . . . . . . . . . . . . 25
122 8.6.3. Example: Partial Retrieval of vCards Matching
123 NICKNAME . . . . . . . . . . . . . . . . . . . . . . . 26
124 8.6.4. Example: Partial Retrieval of vCards Matching a
125 Full Name or Email Address . . . . . . . . . . . . . . 27
126 8.6.5. Example: Truncated Results . . . . . . . . . . . . . . 29
127 8.7. CARDDAV:addressbook-multiget Report . . . . . . . . . . . 31
128 8.7.1. Example: CARDDAV:addressbook-multiget Report . . . . . 32
129 8.7.2. Example: CARDDAV:addressbook-multiget Report . . . . . 33
130 9. Client Guidelines . . . . . . . . . . . . . . . . . . . . . . 34
131 9.1. Restrict the Properties Returned . . . . . . . . . . . . . 34
132 9.2. Avoiding Lost Updates . . . . . . . . . . . . . . . . . . 35
133 9.3. Client Configuration . . . . . . . . . . . . . . . . . . . 35
134 9.4. Finding Other Users' Address Books . . . . . . . . . . . . 35
135 10. XML Element Definitions . . . . . . . . . . . . . . . . . . . 36
136 10.1. CARDDAV:addressbook XML Element . . . . . . . . . . . . . 36
137 10.2. CARDDAV:supported-collation XML Element . . . . . . . . . 36
138 10.3. CARDDAV:addressbook-query XML Element . . . . . . . . . . 37
139 10.4. CARDDAV:address-data XML Element . . . . . . . . . . . . . 37
140 10.4.1. CARDDAV:allprop XML Element . . . . . . . . . . . . . 39
141 10.4.2. CARDDAV:prop XML Element . . . . . . . . . . . . . . . 39
142 10.5. CARDDAV:filter XML Element . . . . . . . . . . . . . . . . 40
143 10.5.1. CARDDAV:prop-filter XML Element . . . . . . . . . . . 40
144 10.5.2. CARDDAV:param-filter XML Element . . . . . . . . . . . 41
145 10.5.3. CARDDAV:is-not-defined XML Element . . . . . . . . . . 42
146 10.5.4. CARDDAV:text-match XML Element . . . . . . . . . . . . 42
147 10.6. CARDDAV:limit XML Element . . . . . . . . . . . . . . . . 43
148 10.6.1. CARDDAV:nresults XML Element . . . . . . . . . . . . . 44
149 10.7. CARDDAV:addressbook-multiget XML Element . . . . . . . . . 44
150 11. Service Discovery via SRV Records . . . . . . . . . . . . . . 45
151 12. Internationalization Considerations . . . . . . . . . . . . . 45
152 13. Security Considerations . . . . . . . . . . . . . . . . . . . 45
153 14. IANA Consideration . . . . . . . . . . . . . . . . . . . . . . 46
154 14.1. Namespace Registration . . . . . . . . . . . . . . . . . . 46
155 15. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 46
156 16. References . . . . . . . . . . . . . . . . . . . . . . . . . . 47
157 16.1. Normative References . . . . . . . . . . . . . . . . . . . 47
158 16.2. Informative References . . . . . . . . . . . . . . . . . . 48
159
160
161
162
163
164
165
166
167
168
169
170Daboo Standards Track [Page 3]
171
172RFC 6352 CardDAV August 2011
173
174
1751. Introduction and Overview
176
177 Address books containing contact information are a key component of
178 personal information management tools, such as email, calendaring and
179 scheduling, and instant messaging clients. To date several protocols
180 have been used for remote access to contact data, including the
181 Lightweight Directory Access Protocol (LDAP) [RFC4510], Internet
182 Message Support Protocol [IMSP], and Application Configuration Access
183 Protocol (ACAP) [RFC2244], together with SyncML used for
184 synchronization of such data.
185
186 WebDAV [RFC4918] offers a number of advantages as a framework or
187 basis for address book access and management. Most of these
188 advantages boil down to a significant reduction in the costs of
189 design, implementation, interoperability testing, and deployment.
190
191 The key features of address book support with WebDAV are:
192
193 1. Ability to use multiple address books with hierarchical layout.
194
195 2. Ability to control access to individual address books and address
196 entries as per WebDAV Access Control List (ACL) [RFC3744].
197
198 3. Principal collections can be used to enumerate and query other
199 users on the system as per WebDAV ACL [RFC3744].
200
201 4. Server-side searching of address data, avoiding the need for
202 clients to download an entire address book in order to do a quick
203 address 'expansion' operation.
204
205 5. Well-defined internationalization support through WebDAV's use of
206 XML.
207
208 6. Use of vCards [RFC2426] for well-defined address schema to
209 enhance client interoperability.
210
211 7. Many limited clients (e.g., mobile devices) contain an HTTP stack
212 that makes implementing WebDAV much easier than other protocols.
213
214 The key disadvantage of address book support in WebDAV is:
215
216 1. Lack of change notification. Many of the alternative protocols
217 also lack this ability. However, an extension for push
218 notifications could easily be developed.
219
220 vCard is a MIME directory profile aimed at encapsulating personal
221 addressing and contact information about people. The specification
222 of vCard was originally done by the Versit consortium, with a
223
224
225
226Daboo Standards Track [Page 4]
227
228RFC 6352 CardDAV August 2011
229
230
231 subsequent 3.0 version standardized by the IETF [RFC2426]. vCard is
232 in widespread use in email clients and mobile devices as a means of
233 encapsulating address information for transport via email or for
234 import/export and synchronization operations.
235
236 An update to vCard -- vCard v4 -- is currently being developed
237 [RFC6350] and is compatible with this specification.
238
2392. Conventions
240
241 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
242 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
243 document are to be interpreted as described in [RFC2119].
244
245 The term "protected" is used in the Conformance field of property
246 definitions as defined in Section 15 of [RFC4918].
247
248 This document uses XML DTD fragments ([W3C.REC-xml-20081126], Section
249 3.2) as a purely notational convention. WebDAV request and response
250 bodies cannot be validated by a DTD due to the specific extensibility
251 rules defined in Section 17 of [RFC4918] and due to the fact that all
252 XML elements defined by that specification use the XML namespace name
253 "DAV:". In particular:
254
255 1. Element names use the "DAV:" namespace.
256
257 2. Element ordering is irrelevant unless explicitly stated.
258
259 3. Extension elements (elements not already defined as valid child
260 elements) may be added anywhere, except when explicitly stated
261 otherwise.
262
263 4. Extension attributes (attributes not already defined as valid for
264 this element) may be added anywhere, except when explicitly
265 stated otherwise.
266
267 The namespace "urn:ietf:params:xml:ns:carddav" is reserved for the
268 XML elements defined in this specification, its revisions, and
269 related CardDAV specifications. XML elements defined by individual
270 implementations MUST NOT use the "urn:ietf:params:xml:ns:carddav"
271 namespace, and instead should use a namespace that they control.
272
273 When XML element types in the namespaces "DAV:" and
274 "urn:ietf:params:xml:ns:carddav" are referenced in this document
275 outside of the context of an XML fragment, the strings "DAV:" and
276 "CARDDAV:" will be prefixed to the element types, respectively.
277
278
279
280
281
282Daboo Standards Track [Page 5]
283
284RFC 6352 CardDAV August 2011
285
286
287 This document inherits, and sometimes extends, DTD productions from
288 Section 14 of [RFC4918].
289
290 Also, note that some CardDAV XML element names are identical to
291 WebDAV XML element names, though their namespace differs. Care must
292 be taken not to confuse the two sets of names.
293
2943. Requirements Overview
295
296 This section lists what functionality is required of a CardDAV
297 server. To advertise support for CardDAV, a server:
298
299 o MUST support vCard v3 [RFC2426] as a media type for the address
300 object resource format;
301
302 o MUST support WebDAV Class 3 [RFC4918];
303
304 o MUST support WebDAV ACL [RFC3744];
305
306 o MUST support secure transport as defined in [RFC2818] using
307 Transport Layer Security (TLS) [RFC5246] and using the certificate
308 validation procedures described in [RFC5280];
309
310 o MUST support ETags [RFC2616] with additional requirements
311 specified in Section 6.3.2.3 of this document;
312
313 o MUST support all address book reports defined in Section 8 of this
314 document; and
315
316 o MUST advertise support on all address book collections and address
317 object resources for the address book reports in the
318 DAV:supported-report-set property, as defined in Versioning
319 Extensions to WebDAV [RFC3253].
320
321 In addition, a server:
322
323 o SHOULD support vCard v4 [RFC6350] as a media type for the address
324 object resource format;
325
326 o SHOULD support the extended MKCOL method [RFC5689] to create
327 address book collections as defined in Section 6.3.1 of this
328 document.
329
330 o SHOULD support the DAV:current-user-principal-URL property as
331 defined in [RFC5397] to give clients a fast way to locate user
332 principals.
333
334
335
336
337
338Daboo Standards Track [Page 6]
339
340RFC 6352 CardDAV August 2011
341
342
3434. Address Book Data Model
344
345 As a brief overview, a CardDAV address book is modeled as a WebDAV
346 collection with a well-defined structure; each of these address book
347 collections contains a number of resources representing address
348 objects as their direct child resources. Each resource representing
349 an address object is called an "address object resource". Each
350 address object resource and each address book collection can be
351 individually locked and have individual WebDAV properties.
352 Requirements derived from this model are provided in Sections 5.1 and
353 5.2.
354
3554.1. Address Book Server
356
357 A CardDAV server is an address-aware engine combined with a WebDAV
358 server. The server may include address data in some parts of its URL
359 namespace and non-address data in other parts.
360
361 A WebDAV server can advertise itself as a CardDAV server if it
362 supports the functionality defined in this specification at any point
363 within the root of its repository. That might mean that address data
364 is spread throughout the repository and mixed with non-address data
365 in nearby collections (e.g., address data may be found in /lisa/
366 addressbook/ as well as in /bernard/addressbook/, and non-address
367 data in /lisa/calendars/). Or, it might mean that address data can
368 be found only in certain sections of the repository (e.g.,
369 /addressbooks/user/). Address book features are only required in the
370 repository sections that are or contain address objects. So, a
371 repository confining address data to the /carddav/ collection would
372 only need to support the CardDAV required features within that
373 collection.
374
375 The CardDAV server is the canonical location for address data and
376 state information. Clients may submit requests to change data or
377 download data. Clients may store address objects offline and attempt
378 to synchronize at a later time. Address data on the server can
379 change between the time of last synchronization and when attempting
380 an update, as address book collections may be shared and accessible
381 via multiple clients. Entity tags and locking help this work.
382
3835. Address Book Resources
384
3855.1. Address Object Resources
386
387 This specification uses vCard as the default format for address or
388 contact information being stored on the server. However, this
389 specification does allow other formats for address data provided that
390 the server advertises support for those additional formats as
391
392
393
394Daboo Standards Track [Page 7]
395
396RFC 6352 CardDAV August 2011
397
398
399 described below. The requirements in this section pertain to vCard
400 address data or formats that follow the semantics of vCard data.
401
402 Address object resources contained in address book collections MUST
403 contain a single vCard component only.
404
405 vCard components in an address book collection MUST have a UID
406 property value that MUST be unique in the scope of the address book
407 collection in which it is contained.
408
4095.1.1. Data Type Conversion
410
411 Servers might support more than one primary media type for address
412 object resources, for example, vCard v3.0 and vCard v4.0. In such
413 cases, servers have to accept all media types that they advertise via
414 the CARDDAV:supported-address-data WebDAV property (see
415 Section 6.2.2).
416
417 However, clients can use standard HTTP content negotiation behavior
418 (the Accept request header defined in Section 14.1 of [RFC2616]) to
419 request that an address object resource's data be returned in a
420 specific media type format. For example, a client merely capable of
421 handling vCard v3.0 would only want to have address object resources
422 returned in v3.0 format.
423
424 Additionally, REPORT requests, defined later in this specification,
425 allow for the return of address object resource data within an XML
426 response body. Again, the client can use content negotiation to
427 request that data be returned in a specific media type by specifying
428 appropriate attributes on the CARDDAV:address-data XML element used
429 in the request body (see Section 10.4).
430
431 In some cases, it might not be possible for a server to convert from
432 one media type to another. When that happens, the server MUST return
433 the CARDDAV:supported-address-data-conversion precondition (see
434 below) in the response body (when the failure to convert applies to
435 the entire response) or use that same precondition code in the
436 DAV:response XML element in the response for the targeted address
437 object resource when one of the REPORTs defined below is used. See
438 Section 8.7.2 for an example of this.
439
4405.1.1.1. Additional Precondition for GET
441
442 This specification creates additional preconditions for the GET
443 method.
444
445
446
447
448
449
450Daboo Standards Track [Page 8]
451
452RFC 6352 CardDAV August 2011
453
454
455 The new precondition is:
456
457 (CARDDAV:supported-address-data-conversion): The resource targeted
458 by the GET request can be converted to the media type specified in
459 the Accept request header included with the request.
460
4615.2. Address Book Collections
462
463 Address book collections appear to clients as a WebDAV collection
464 resource, identified by a URL. An address book collection MUST
465 report the DAV:collection and CARDDAV:addressbook XML elements in the
466 value of the DAV:resourcetype property. The element type declaration
467 for CARDDAV:addressbook is:
468
469 <!ELEMENT addressbook EMPTY>
470
471 An address book collection can be created through provisioning (e.g.,
472 automatically created when a user's account is provisioned), or it
473 can be created with the extended MKCOL method (see Section 6.3.1).
474 This can be used by a user to create additional address books (e.g.,
475 "soccer team members") or for users to share an address book (e.g.,
476 "sales team contacts"). However, note that this document doesn't
477 define what extra address book collections are for. Users must rely
478 on non-standard cues to find out what an address book collection is
479 for, or use the CARDDAV:addressbook-description property defined in
480 Section 6.2.1 to provide such a cue.
481
482 The following restrictions are applied to the resources within an
483 address book collection:
484
485 a. Address book collections MUST only contain address object
486 resources and collections that are not address book collections.
487 That is, the only "top-level" non-collection resources allowed in
488 an address book collection are address object resources. This
489 ensures that address book clients do not have to deal with non-
490 address data in an address book collection, though they do have
491 to distinguish between address object resources and collections
492 when using standard WebDAV techniques to examine the contents of
493 a collection.
494
495 b. Collections contained in address book collections MUST NOT
496 contain address book collections at any depth. That is,
497 "nesting" of address book collections within other address book
498 collections at any depth is not allowed. This specification does
499 not define how collections contained in an address book
500 collection are used or how they relate to any address object
501 resources contained in the address book collection.
502
503
504
505
506Daboo Standards Track [Page 9]
507
508RFC 6352 CardDAV August 2011
509
510
511 Multiple address book collections MAY be children of the same
512 collection.
513
5146. Address Book Feature
515
5166.1. Address Book Support
517
518 A server supporting the features described in this document MUST
519 include "addressbook" as a field in the DAV response header from an
520 OPTIONS request on any resource that supports any address book
521 properties, reports, or methods. A value of "addressbook" in the DAV
522 response header MUST indicate that the server supports all MUST level
523 requirements and REQUIRED features specified in this document.
524
5256.1.1. Example: Using OPTIONS for the Discovery of Support for CardDAV
526
527 >> Request <<
528
529 OPTIONS /addressbooks/users/ HTTP/1.1
530 Host: addressbook.example.com
531
532 >> Response <<
533
534 HTTP/1.1 200 OK
535 Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
536 Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL
537 DAV: 1, 2, 3, access-control, addressbook
538 DAV: extended-mkcol
539 Date: Sat, 11 Nov 2006 09:32:12 GMT
540 Content-Length: 0
541
542 In this example, the OPTIONS response indicates that the server
543 supports CardDAV in this namespace; therefore, the '/addressbooks/
544 users/' collection may be used as a parent for address book
545 collections as the extended MKCOL method is available and as a
546 possible target for REPORT requests for address book reports.
547
5486.2. Address Book Properties
549
5506.2.1. CARDDAV:addressbook-description Property
551
552 Name: addressbook-description
553
554 Namespace: urn:ietf:params:xml:ns:carddav
555
556 Purpose: Provides a human-readable description of the address book
557 collection.
558
559
560
561
562Daboo Standards Track [Page 10]
563
564RFC 6352 CardDAV August 2011
565
566
567 Value: Any text.
568
569 Protected: SHOULD NOT be protected so that users can specify a
570 description.
571
572 COPY/MOVE behavior: This property value SHOULD be preserved in COPY
573 and MOVE operations.
574
575 allprop behavior: SHOULD NOT be returned by a PROPFIND DAV:allprop
576 request.
577
578 Description: This property contains a description of the address
579 book collection that is suitable for presentation to a user. The
580 xml:lang attribute can be used to add a language tag for the value
581 of this property.
582
583 Definition:
584
585 <!ELEMENT addressbook-description (#PCDATA)>
586 <!-- PCDATA value: string -->
587
588 Example:
589
590 <C:addressbook-description xml:lang="fr-CA"
591 xmlns:C="urn:ietf:params:xml:ns:carddav"
592 >Adresses de Oliver Daboo</C:addressbook-description>
593
5946.2.2. CARDDAV:supported-address-data Property
595
596 Name: supported-address-data
597
598 Namespace: urn:ietf:params:xml:ns:carddav
599
600 Purpose: Specifies what media types are allowed for address object
601 resources in an address book collection.
602
603 Protected: MUST be protected as it indicates the level of support
604 provided by the server.
605
606 COPY/MOVE behavior: This property value MUST be preserved in COPY
607 and MOVE operations.
608
609 allprop behavior: SHOULD NOT be returned by a PROPFIND DAV:allprop
610 request.
611
612 Description: The CARDDAV:supported-address-data property is used to
613 specify the media type supported for the address object resources
614 contained in a given address book collection (e.g., vCard version
615
616
617
618Daboo Standards Track [Page 11]
619
620RFC 6352 CardDAV August 2011
621
622
623 3.0). Any attempt by the client to store address object resources
624 with a media type not listed in this property MUST result in an
625 error, with the CARDDAV:supported-address-data precondition
626 (Section 6.3.2.1) being violated. In the absence of this
627 property, the server MUST only accept data with the media type
628 "text/vcard" and vCard version 3.0, and clients can assume that is
629 all the server will accept.
630
631 Definition:
632
633 <!ELEMENT supported-address-data (address-data-type+)>
634
635 <!ELEMENT address-data-type EMPTY>
636 <!ATTLIST address-data-type content-type CDATA "text/vcard"
637 version CDATA "3.0">
638 <!-- content-type value: a MIME media type -->
639 <!-- version value: a version string -->
640
641 Example:
642
643 <C:supported-address-data
644 xmlns:C="urn:ietf:params:xml:ns:carddav">
645 <C:address-data-type content-type="text/vcard" version="3.0"/>
646 </C:supported-address-data>
647
6486.2.3. CARDDAV:max-resource-size Property
649
650 Name: max-resource-size
651
652 Namespace: urn:ietf:params:xml:ns:carddav
653
654 Purpose: Provides a numeric value indicating the maximum size in
655 octets of a resource that the server is willing to accept when an
656 address object resource is stored in an address book collection.
657
658 Value: Any text representing a numeric value.
659
660 Protected: MUST be protected as it indicates limits provided by the
661 server.
662
663 COPY/MOVE behavior: This property value MUST be preserved in COPY
664 and MOVE operations.
665
666 allprop behavior: SHOULD NOT be returned by a PROPFIND DAV:allprop
667 request.
668
669
670
671
672
673
674Daboo Standards Track [Page 12]
675
676RFC 6352 CardDAV August 2011
677
678
679 Description: The CARDDAV:max-resource-size is used to specify a
680 numeric value that represents the maximum size in octets that the
681 server is willing to accept when an address object resource is
682 stored in an address book collection. Any attempt to store an
683 address book object resource exceeding this size MUST result in an
684 error, with the CARDDAV:max-resource-size precondition
685 (Section 6.3.2.1) being violated. In the absence of this
686 property, the client can assume that the server will allow storing
687 a resource of any reasonable size.
688
689 Definition:
690
691 <!ELEMENT max-resource-size (#PCDATA)>
692 <!-- PCDATA value: a numeric value (positive decimal integer) -->
693
694 Example:
695
696 <C:max-resource-size xmlns:C="urn:ietf:params:xml:ns:carddav"
697 >102400</C:max-resource-size>
698
6996.3. Creating Resources
700
701 Address book collections and address object resources may be created
702 by either a CardDAV client or the CardDAV server. This specification
703 defines restrictions and a data model that both clients and servers
704 MUST adhere to when manipulating such address data.
705
7066.3.1. Extended MKCOL Method
707
708 An HTTP request using the extended MKCOL method [RFC5689] can be used
709 to create a new address book collection resource. A server MAY
710 restrict address book collection creation to particular collections.
711
712 To create an address book, the client sends an extended MKCOL request
713 to the server and in the body of the request sets the
714 DAV:resourcetype property to the resource type for an address book
715 collection as defined in Section 5.2.
716
717 Support for creating address books on the server is only RECOMMENDED
718 and not REQUIRED because some address book stores only support one
719 address book per user (or principal), and those are typically pre-
720 created for each account. However, servers and clients are strongly
721 encouraged to support address book creation whenever possible to
722 allow users to create multiple address book collections to help
723 organize their data better.
724
725
726
727
728
729
730Daboo Standards Track [Page 13]
731
732RFC 6352 CardDAV August 2011
733
734
735 The DAV:displayname property can be used for a human-readable name of
736 the address book. Clients can either specify the value of the
737 DAV:displayname property in the request body of the extended MKCOL
738 request or, alternatively, issue a PROPPATCH request to change the
739 DAV:displayname property to the appropriate value immediately after
740 using the extended MKCOL request. When displaying address book
741 collections to users, clients SHOULD check the DAV:displayname
742 property and use that value as the name of the address book. In the
743 event that the DAV:displayname property is not set, the client MAY
744 use the last part of the address book collection URI as the name;
745 however, that path segment may be "opaque" and not represent any
746 meaningful human-readable text.
747
7486.3.1.1. Example - Successful MKCOL Request
749
750 This example creates an address book collection called /home/lisa/
751 addressbook/ on the server addressbook.example.com with specific
752 values for the properties DAV:resourcetype, DAV:displayname, and
753 CARDDAV:addressbook-description.
754
755 >> Request <<
756
757 MKCOL /home/lisa/addressbook/ HTTP/1.1
758 Host: addressbook.example.com
759 Content-Type: text/xml; charset="utf-8"
760 Content-Length: xxx
761
762 <?xml version="1.0" encoding="utf-8" ?>
763 <D:mkcol xmlns:D="DAV:"
764 xmlns:C="urn:ietf:params:xml:ns:carddav">
765 <D:set>
766 <D:prop>
767 <D:resourcetype>
768 <D:collection/>
769 <C:addressbook/>
770 </D:resourcetype>
771 <D:displayname>Lisa's Contacts</D:displayname>
772 <C:addressbook-description xml:lang="en"
773 >My primary address book.</C:addressbook-description>
774 </D:prop>
775 </D:set>
776 </D:mkcol>
777
778
779
780
781
782
783
784
785
786Daboo Standards Track [Page 14]
787
788RFC 6352 CardDAV August 2011
789
790
791 >> Response <<
792
793 HTTP/1.1 201 Created
794 Cache-Control: no-cache
795 Date: Sat, 11 Nov 2006 09:32:12 GMT
796 Content-Type: application/xml; charset="utf-8"
797 Content-Length: xxxx
798
799 <?xml version="1.0" encoding="utf-8" ?>
800 <D:mkcol-response xmlns:D="DAV:"
801 xmlns:C="urn:ietf:params:xml:ns:carddav">
802 <D:propstat>
803 <D:prop>
804 <D:resourcetype/>
805 <D:displayname/>
806 <C:addressbook-description/>
807 </D:prop>
808 <D:status>HTTP/1.1 200 OK</D:status>
809 </D:propstat>
810 </D:mkcol-response>
811
8126.3.2. Creating Address Object Resources
813
814 Clients populate address book collections with address object
815 resources. The URL for each address object resource is entirely
816 arbitrary and does not need to bear a specific relationship (but
817 might) to the address object resource's vCard properties or other
818 metadata. New address object resources MUST be created with a PUT
819 request targeted at an unmapped URI. A PUT request targeted at a
820 mapped URI updates an existing address object resource.
821
822 When servers create new resources, it's not hard for the server to
823 choose a unique URL. It's slightly tougher for clients, because a
824 client might not want to examine all resources in the collection and
825 might not want to lock the entire collection to ensure that a new one
826 isn't created with a name collision. However, there is an HTTP
827 feature to mitigate this. If the client intends to create a new
828 address resource, the client SHOULD use the HTTP header "If-None-
829 Match: *" on the PUT request. The Request-URI on the PUT request
830 MUST include the target collection, where the resource is to be
831 created, plus the name of the resource in the last path segment. The
832 "If-None-Match" header ensures that the client will not inadvertently
833 overwrite an existing resource even if the last path segment turned
834 out to already be used.
835
836
837
838
839
840
841
842Daboo Standards Track [Page 15]
843
844RFC 6352 CardDAV August 2011
845
846
847 >> Request <<
848
849 PUT /lisa/addressbook/newvcard.vcf HTTP/1.1
850 If-None-Match: *
851 Host: addressbook.example.com
852 Content-Type: text/vcard
853 Content-Length: xxx
854
855 BEGIN:VCARD
856 VERSION:3.0
857 FN:Cyrus Daboo
858 N:Daboo;Cyrus
859 ADR;TYPE=POSTAL:;2822 Email HQ;Suite 2821;RFCVille;PA;15213;USA
860 EMAIL;TYPE=INTERNET,PREF:cyrus@example.com
861 NICKNAME:me
862 NOTE:Example VCard.
863 ORG:Self Employed
864 TEL;TYPE=WORK,VOICE:412 605 0499
865 TEL;TYPE=FAX:412 605 0705
866 URL:http://www.example.com
867 UID:1234-5678-9000-1
868 END:VCARD
869
870 >> Response <<
871
872 HTTP/1.1 201 Created
873 Date: Thu, 02 Sep 2004 16:53:32 GMT
874 Content-Length: 0
875 ETag: "123456789-000-111"
876
877 The request to change an existing address object resource without
878 overwriting a change made on the server uses a specific ETag in an
879 "If-Match" header, rather than the "If-None-Match" header.
880
881 File names for vCards are commonly suffixed by ".vcf", and clients
882 may choose to use the same convention for URLs.
883
8846.3.2.1. Additional Preconditions for PUT, COPY, and MOVE
885
886 This specification creates additional preconditions for the PUT,
887 COPY, and MOVE methods. These preconditions apply:
888
889 o When a PUT operation of an address object resource into an address
890 book collection occurs.
891
892 o When a COPY or MOVE operation of an address object resource into
893 an address book collection occurs.
894
895
896
897
898Daboo Standards Track [Page 16]
899
900RFC 6352 CardDAV August 2011
901
902
903 The new preconditions are:
904
905 (CARDDAV:supported-address-data): The resource submitted in the
906 PUT request, or targeted by a COPY or MOVE request, MUST be a
907 supported media type (i.e., vCard) for address object resources.
908
909 (CARDDAV:valid-address-data): The resource submitted in the PUT
910 request, or targeted by a COPY or MOVE request, MUST be valid data
911 for the media type being specified (i.e., MUST contain valid vCard
912 data).
913
914 (CARDDAV:no-uid-conflict): The resource submitted in the PUT
915 request, or targeted by a COPY or MOVE request, MUST NOT specify a
916 vCard UID property value already in use in the targeted address
917 book collection or overwrite an existing address object resource
918 with one that has a different UID property value. Servers SHOULD
919 report the URL of the resource that is already making use of the
920 same UID property value in the DAV:href element.
921
922 <!ELEMENT no-uid-conflict (DAV:href)>
923
924 (CARDDAV:addressbook-collection-location-ok): In a COPY or MOVE
925 request, when the Request-URI is an address book collection, the
926 URI targeted by the Destination HTTP Request header MUST identify
927 a location where an address book collection can be created.
928
929 (CARDDAV:max-resource-size): The resource submitted in the PUT
930 request, or targeted by a COPY or MOVE request, MUST have a size
931 in octets less than or equal to the value of the
932 CARDDAV:max-resource-size property value (Section 6.2.3) on the
933 address book collection where the resource will be stored.
934
9356.3.2.2. Non-Standard vCard Properties and Parameters
936
937 vCard provides a "standard mechanism for doing non-standard things".
938 This extension support allows implementers to make use of non-
939 standard vCard properties and parameters whose names are prefixed
940 with the text "X-".
941
942 Servers MUST support the use of non-standard properties and
943 parameters in address object resources stored via the PUT method.
944
945 Servers may need to enforce rules for their own "private" properties
946 or parameters, so servers MAY reject any attempt by the client to
947 change those or use values for those outside of any restrictions the
948 server may have. A server SHOULD ensure that any "private"
949
950
951
952
953
954Daboo Standards Track [Page 17]
955
956RFC 6352 CardDAV August 2011
957
958
959 properties or parameters it uses follow the convention of including a
960 vendor ID in the "X-" name, as described in Section 3.8 of [RFC2426],
961 e.g., "X-ABC-PRIVATE".
962
9636.3.2.3. Address Object Resource Entity Tag
964
965 The DAV:getetag property MUST be defined and set to a strong entity
966 tag on all address object resources.
967
968 A response to a GET request targeted at an address object resource
969 MUST contain an ETag response header field indicating the current
970 value of the strong entity tag of the address object resource.
971
972 Servers SHOULD return a strong entity tag (ETag header) in a PUT
973 response when the stored address object resource is equivalent by
974 octet equality to the address object resource submitted in the body
975 of the PUT request. This allows clients to reliably use the returned
976 strong entity tag for data synchronization purposes. For instance,
977 the client can do a PROPFIND request on the stored address object
978 resource, have the DAV:getetag property returned, compare that value
979 with the strong entity tag it received on the PUT response, and know
980 that if they are equal, then the address object resource on the
981 server has not been changed.
982
983 In the case where the data stored by a server as a result of a PUT
984 request is not equivalent by octet equality to the submitted address
985 object resource, the behavior of the ETag response header is not
986 specified here, with the exception that a strong entity tag MUST NOT
987 be returned in the response. As a result, a client may need to
988 retrieve the modified address object resource (and ETag) as a basis
989 for further changes, rather than use the address object resource it
990 had sent with the PUT request.
991
9927. Address Book Access Control
993
994 CardDAV servers MUST support and adhere to the requirements of WebDAV
995 ACL [RFC3744]. WebDAV ACL provides a framework for an extensible set
996 of privileges that can be applied to WebDAV collections and ordinary
997 resources.
998
9997.1. Additional Principal Properties
1000
1001 This section defines additional properties for WebDAV principal
1002 resources as defined in [RFC3744].
1003
1004
1005
1006
1007
1008
1009
1010Daboo Standards Track [Page 18]
1011
1012RFC 6352 CardDAV August 2011
1013
1014
10157.1.1. CARDDAV:addressbook-home-set Property
1016
1017 Name: addressbook-home-set
1018
1019 Namespace: urn:ietf:params:xml:ns:carddav
1020
1021 Purpose: Identifies the URL of any WebDAV collections that contain
1022 address book collections owned by the associated principal
1023 resource.
1024
1025 Protected: MAY be protected if the server has fixed locations in
1026 which address books are created.
1027
1028 COPY/MOVE behavior: This property value MUST be preserved in COPY
1029 and MOVE operations.
1030
1031 allprop behavior: SHOULD NOT be returned by a PROPFIND DAV:allprop
1032 request.
1033
1034 Description: The CARDDAV:addressbook-home-set property is meant to
1035 allow users to easily find the address book collections owned by
1036 the principal. Typically, users will group all the address book
1037 collections that they own under a common collection. This
1038 property specifies the URL of collections that are either address
1039 book collections or ordinary collections that have child or
1040 descendant address book collections owned by the principal.
1041
1042 Definition:
1043
1044 <!ELEMENT addressbook-home-set (DAV:href*)>
1045
1046 Example:
1047
1048 <C:addressbook-home-set xmlns:D="DAV:"
1049 xmlns:C="urn:ietf:params:xml:ns:carddav">
1050 <D:href>/bernard/addresses/</D:href>
1051 </C:addressbook-home-set>
1052
10537.1.2. CARDDAV:principal-address Property
1054
1055 Name: principal-address
1056
1057 Namespace: urn:ietf:params:xml:ns:carddav
1058
1059 Purpose: Identifies the URL of an address object resource that
1060 corresponds to the user represented by the principal.
1061
1062
1063
1064
1065
1066Daboo Standards Track [Page 19]
1067
1068RFC 6352 CardDAV August 2011
1069
1070
1071 Protected: MAY be protected if the server provides a fixed location
1072 for principal addresses.
1073
1074 COPY/MOVE behavior: This property value MUST be preserved in COPY
1075 and MOVE operations.
1076
1077 allprop behavior: SHOULD NOT be returned by a PROPFIND DAV:allprop
1078 request.
1079
1080 Description: The CARDDAV:principal-address property is meant to
1081 allow users to easily find contact information for users
1082 represented by principals on the system. This property specifies
1083 the URL of the resource containing the corresponding contact
1084 information. The resource could be an address object resource in
1085 an address book collection, or it could be a resource in a
1086 "regular" collection.
1087
1088 Definition:
1089
1090 <!ELEMENT principal-address (DAV:href)>
1091
1092 Example:
1093
1094 <C:principal-address xmlns:D="DAV:"
1095 xmlns:C="urn:ietf:params:xml:ns:carddav">
1096 <D:href>/system/cyrus.vcf</D:href>
1097 </C:principal-address>
1098
10998. Address Book Reports
1100
1101 This section defines the reports that CardDAV servers MUST support on
1102 address book collections and address object resources.
1103
1104 CardDAV servers MUST advertise support for these reports on all
1105 address book collections and address object resources with the
1106 DAV:supported-report-set property defined in Section 3.1.5 of
1107 [RFC3253]. CardDAV servers MAY also advertise support for these
1108 reports on ordinary collections.
1109
1110 Some of these reports allow address data (from possibly multiple
1111 resources) to be returned.
1112
11138.1. REPORT Method
1114
1115 The REPORT method (defined in Section 3.6 of [RFC3253]) provides an
1116 extensible mechanism for obtaining information about a resource.
1117 Unlike the PROPFIND method, which returns the value of one or more
1118 named properties, the REPORT method can involve more complex
1119
1120
1121
1122Daboo Standards Track [Page 20]
1123
1124RFC 6352 CardDAV August 2011
1125
1126
1127 processing. REPORT is valuable in cases where the server has access
1128 to all of the information needed to perform the complex request (such
1129 as a query), and where it would require multiple requests for the
1130 client to retrieve the information needed to perform the same
1131 request.
1132
1133 A server that supports this specification MUST support the
1134 DAV:expand-property report (defined in Section 3.8 of [RFC3253]).
1135
11368.2. Ordinary Collections
1137
1138 Servers MAY support the reports defined in this document on ordinary
1139 collections (collections that are not address book collections) in
1140 addition to address book collections or address object resources. In
1141 computing responses to the reports on ordinary collections, servers
1142 MUST only consider address object resources contained in address book
1143 collections that are targeted by the REPORT based on the value of the
1144 Depth request header.
1145
11468.3. Searching Text: Collations
1147
1148 Some of the reports defined in this section do text matches of
1149 character strings provided by the client and compared to stored
1150 address data. Since vCard data is by default encoded in the UTF-8
1151 charset and may include characters outside of the US-ASCII charset
1152 range in some property and parameter values, there is a need to
1153 ensure that text matching follows well-defined rules.
1154
1155 To deal with this, this specification makes use of the IANA Collation
1156 Registry defined in [RFC4790] to specify collations that may be used
1157 to carry out the text comparison operations with a well-defined rule.
1158
1159 Collations supported by the server MUST support "equality" and
1160 "substring" match operations as per [RFC4790], Section 4.2, including
1161 the "prefix" and "suffix" options for "substring" matching. CardDAV
1162 uses these match options for "equals", "contains", "starts-with", and
1163 "ends-with" match operations.
1164
1165 CardDAV servers are REQUIRED to support the "i;ascii-casemap"
1166 [RFC4790] and "i;unicode-casemap" [RFC5051] collations and MAY
1167 support other collations.
1168
1169 Servers MUST advertise the set of collations that they support via
1170 the CARDDAV:supported-collation-set property defined on any resource
1171 that supports reports that use collations.
1172
1173
1174
1175
1176
1177
1178Daboo Standards Track [Page 21]
1179
1180RFC 6352 CardDAV August 2011
1181
1182
1183 In the absence of a collation explicitly specified by the client, or
1184 if the client specifies the "default" collation identifier (as
1185 defined in [RFC4790], Section 3.1), the server MUST default to using
1186 "i;unicode-casemap" as the collation.
1187
1188 Wildcards (as defined in [RFC4790], Section 3.2) MUST NOT be used in
1189 the collation identifier.
1190
1191 If the client chooses a collation not supported by the server, the
1192 server MUST respond with a CARDDAV:supported-collation precondition
1193 error response.
1194
11958.3.1. CARDDAV:supported-collation-set Property
1196
1197 Name: supported-collation-set
1198
1199 Namespace: urn:ietf:params:xml:ns:carddav
1200
1201 Purpose: Identifies the set of collations supported by the server
1202 for text matching operations.
1203
1204 Protected: MUST be protected as it indicates support provided by the
1205 server.
1206
1207 COPY/MOVE behavior: This property value MUST be preserved in COPY
1208 and MOVE operations.
1209
1210 allprop behavior: SHOULD NOT be returned by a PROPFIND DAV:allprop
1211 request.
1212
1213 Description: The CARDDAV:supported-collation-set property contains
1214 two or more CARDDAV:supported-collation elements that specify the
1215 identifiers of the collations supported by the server.
1216
1217 Definition:
1218
1219 <!ELEMENT supported-collation-set (
1220 supported-collation
1221 supported-collation
1222 supported-collation*)>
1223 <!-- Both "i;ascii-casemap" and "i;unicode-casemap"
1224 will be present -->
1225
1226 <!ELEMENT supported-collation (#PCDATA)>
1227
1228
1229
1230
1231
1232
1233
1234Daboo Standards Track [Page 22]
1235
1236RFC 6352 CardDAV August 2011
1237
1238
1239 Example:
1240
1241 <C:supported-collation-set
1242 xmlns:C="urn:ietf:params:xml:ns:carddav">
1243 <C:supported-collation>i;ascii-casemap</C:supported-collation>
1244 <C:supported-collation>i;octet</C:supported-collation>
1245 <C:supported-collation>i;unicode-casemap</C:supported-collation>
1246 </C:supported-collation-set>
1247
12488.4. Partial Retrieval
1249
1250 Some address book reports defined in this document allow partial
1251 retrieval of address object resources. A CardDAV client can specify
1252 what information to return in the body of an address book REPORT
1253 request.
1254
1255 A CardDAV client can request particular WebDAV property values, all
1256 WebDAV property values, or a list of the names of the resource's
1257 WebDAV properties. A CardDAV client can also request address data to
1258 be returned and whether all vCard properties should be returned or
1259 only particular ones. See CARDDAV:address-data in Section 10.4.
1260
12618.5. Non-Standard Properties and Parameters
1262
1263 Servers MUST support the use of non-standard vCard property or
1264 parameter names in the CARDDAV:address-data XML element in address
1265 book REPORT requests to allow clients to request that non-standard
1266 properties and parameters be returned in the address data provided in
1267 the response.
1268
1269 Servers MAY support the use of non-standard vCard property or
1270 parameter names in the CARDDAV:prop-filter and CARDDAV:param-filter
1271 XML elements specified in the CARDDAV:filter XML element of address
1272 book REPORT requests.
1273
1274 Servers MUST fail with the CARDDAV:supported-filter precondition if
1275 an address book REPORT request uses a CARDDAV:prop-filter or
1276 CARDDAV:param-filter XML element that makes reference to a non-
1277 standard vCard property or parameter name on which the server does
1278 not support queries.
1279
12808.6. CARDDAV:addressbook-query Report
1281
1282 The CARDDAV:addressbook-query REPORT performs a search for all
1283 address object resources that match a specified filter. The response
1284 of this report will contain all the WebDAV properties and address
1285 object resource data specified in the request. In the case of the
1286
1287
1288
1289
1290Daboo Standards Track [Page 23]
1291
1292RFC 6352 CardDAV August 2011
1293
1294
1295 CARDDAV:address-data XML element, one can explicitly specify the
1296 vCard properties that should be returned in the address object
1297 resource data that matches the filter.
1298
1299 The format of this report is modeled on the PROPFIND method. The
1300 request and response bodies of the CARDDAV:addressbook-query report
1301 use XML elements that are also used by PROPFIND. In particular, the
1302 request can include XML elements to request WebDAV properties to be
1303 returned. When that occurs, the response should follow the same
1304 behavior as PROPFIND with respect to the DAV:multistatus response
1305 elements used to return specific WebDAV property results. For
1306 instance, a request to retrieve the value of a WebDAV property that
1307 does not exist is an error and MUST be noted with a response XML
1308 element that contains a 404 (Not Found) status value.
1309
1310 Support for the CARDDAV:addressbook-query REPORT is REQUIRED.
1311
1312 Marshalling:
1313
1314 The request body MUST be a CARDDAV:addressbook-query XML element
1315 as defined in Section 10.3.
1316
1317 The request MUST include a Depth header. The scope of the query
1318 is determined by the value of the Depth header. For example, to
1319 query all address object resources in an address book collection,
1320 the REPORT would use the address book collection as the Request-
1321 URI and specify a Depth of 1 or infinity.
1322
1323 The response body for a successful request MUST be a
1324 DAV:multistatus XML element (i.e., the response uses the same
1325 format as the response for PROPFIND). In the case where there are
1326 no response elements, the returned DAV:multistatus XML element is
1327 empty.
1328
1329 The response body for a successful CARDDAV:addressbook-query
1330 REPORT request MUST contain a DAV:response element for each
1331 address object that matched the search filter. Address data is
1332 returned in the CARDDAV:address-data XML element inside the
1333 DAV:propstat XML element.
1334
1335 Preconditions:
1336
1337 (CARDDAV:supported-address-data): The attributes "content-type"
1338 and "version" of the CARDDAV:address-data XML element (see
1339 Section 10.4) specify a media type supported by the server for
1340 address object resources.
1341
1342
1343
1344
1345
1346Daboo Standards Track [Page 24]
1347
1348RFC 6352 CardDAV August 2011
1349
1350
1351 (CARDDAV:supported-filter): The CARDDAV:prop-filter (see
1352 Section 10.5.1) and CARDDAV:param-filter (see Section 10.5.2) XML
1353 elements used in the CARDDAV:filter XML element (see Section 10.5)
1354 in the REPORT request only make reference to vCard properties and
1355 parameters for which queries are supported by the server. That
1356 is, if the CARDDAV:filter element attempts to reference an
1357 unsupported vCard property or parameter, this precondition is
1358 violated. A server SHOULD report the CARDDAV:prop-filter or
1359 CARDDAV:param-filter for which it does not provide support.
1360
1361 <!ELEMENT supported-filter (prop-filter*,
1362 param-filter*)>
1363
1364 (CARDDAV:supported-collation): Any XML attribute specifying a
1365 collation MUST specify a collation supported by the server as
1366 described in Section 8.3.
1367
1368 Postconditions:
1369
1370 (DAV:number-of-matches-within-limits): The number of matching
1371 address object resources must fall within server-specific,
1372 predefined limits. For example, this condition might be triggered
1373 if a search specification would cause the return of an extremely
1374 large number of responses.
1375
13768.6.1. Limiting Results
1377
1378 A client can limit the number of results returned by the server
1379 through use of the CARDDAV:limit element in the request body. This
1380 is useful when clients are only interested in a few matches or only
1381 have limited space to display results to users and thus don't need
1382 the overhead of receiving more than that. When the results are
1383 truncated by the server, the server MUST follow the rules below for
1384 indicating a result set truncation to the client.
1385
13868.6.2. Truncation of Results
1387
1388 A server MAY limit the number of resources in a response, for
1389 example, to limit the amount of work expended in processing a query,
1390 or as the result of an explicit limit set by the client. If the
1391 result set is truncated because of such a limit, the response MUST
1392 use status code 207 (Multi-Status), return a DAV:multistatus response
1393 body, and indicate a status of 507 (Insufficient Storage) for the
1394 Request-URI. That DAV:response element SHOULD include a DAV:error
1395 element with the DAV:number-of-matches-within-limits precondition, as
1396 defined in [RFC3744], Section 9.2.
1397
1398
1399
1400
1401
1402Daboo Standards Track [Page 25]
1403
1404RFC 6352 CardDAV August 2011
1405
1406
1407 The server SHOULD also include the partial results in additional
1408 DAV:response elements. If a client-requested limit is being applied,
1409 the 507 response for the Request-URI MUST NOT be included in
1410 calculating the limit (e.g., if the client requests that only a
1411 single result be returned, and multiple matches are present, then the
1412 DAV:multistatus response will include one DAV:response for the
1413 matching resource and one DAV:response for the 507 status on the
1414 Request-URI).
1415
14168.6.3. Example: Partial Retrieval of vCards Matching NICKNAME
1417
1418 In this example, the client requests that the server search for
1419 address object resources that contain a NICKNAME property whose value
1420 equals some specific text and return specific vCard properties for
1421 those vCards found. In addition, the DAV:getetag property is also
1422 requested and returned as part of the response.
1423
1424 >> Request <<
1425
1426 REPORT /home/bernard/addressbook/ HTTP/1.1
1427 Host: addressbook.example.com
1428 Depth: 1
1429 Content-Type: text/xml; charset="utf-8"
1430 Content-Length: xxxx
1431
1432 <?xml version="1.0" encoding="utf-8" ?>
1433 <C:addressbook-query xmlns:D="DAV:"
1434 xmlns:C="urn:ietf:params:xml:ns:carddav">
1435 <D:prop>
1436 <D:getetag/>
1437 <C:address-data>
1438 <C:prop name="VERSION"/>
1439 <C:prop name="UID"/>
1440 <C:prop name="NICKNAME"/>
1441 <C:prop name="EMAIL"/>
1442 <C:prop name="FN"/>
1443 </C:address-data>
1444 </D:prop>
1445 <C:filter>
1446 <C:prop-filter name="NICKNAME">
1447 <C:text-match collation="i;unicode-casemap"
1448 match-type="equals"
1449 >me</C:text-match>
1450 </C:prop-filter>
1451 </C:filter>
1452 </C:addressbook-query>
1453
1454
1455
1456
1457
1458Daboo Standards Track [Page 26]
1459
1460RFC 6352 CardDAV August 2011
1461
1462
1463 >> Response <<
1464
1465 HTTP/1.1 207 Multi-Status
1466 Date: Sat, 11 Nov 2006 09:32:12 GMT
1467 Content-Type: text/xml; charset="utf-8"
1468 Content-Length: xxxx
1469
1470 <?xml version="1.0" encoding="utf-8" ?>
1471 <D:multistatus xmlns:D="DAV:"
1472 xmlns:C="urn:ietf:params:xml:ns:carddav">
1473 <D:response>
1474 <D:href>/home/bernard/addressbook/v102.vcf</D:href>
1475 <D:propstat>
1476 <D:prop>
1477 <D:getetag>"23ba4d-ff11fb"</D:getetag>
1478 <C:address-data>BEGIN:VCARD
1479 VERSION:3.0
1480 NICKNAME:me
1481 UID:34222-232@example.com
1482 FN:Cyrus Daboo
1483 EMAIL:daboo@example.com
1484 END:VCARD
1485 </C:address-data>
1486 </D:prop>
1487 <D:status>HTTP/1.1 200 OK</D:status>
1488 </D:propstat>
1489 </D:response>
1490 </D:multistatus>
1491
14928.6.4. Example: Partial Retrieval of vCards Matching a Full Name or
1493 Email Address
1494
1495 In this example, the client requests that the server search for
1496 address object resources that contain a FN property whose value
1497 contains some specific text or that contain an EMAIL property whose
1498 value contains other text and return specific vCard properties for
1499 those vCards found. In addition, the DAV:getetag property is also
1500 requested and returned as part of the response.
1501
1502 >> Request <<
1503
1504 REPORT /home/bernard/addressbook/ HTTP/1.1
1505 Host: addressbook.example.com
1506 Depth: 1
1507 Content-Type: text/xml; charset="utf-8"
1508 Content-Length: xxxx
1509
1510
1511
1512
1513
1514Daboo Standards Track [Page 27]
1515
1516RFC 6352 CardDAV August 2011
1517
1518
1519 <?xml version="1.0" encoding="utf-8" ?>
1520 <C:addressbook-query xmlns:D="DAV:"
1521 xmlns:C="urn:ietf:params:xml:ns:carddav">
1522 <D:prop>
1523 <D:getetag/>
1524 <C:address-data>
1525 <C:prop name="VERSION"/>
1526 <C:prop name="UID"/>
1527 <C:prop name="NICKNAME"/>
1528 <C:prop name="EMAIL"/>
1529 <C:prop name="FN"/>
1530 </C:address-data>
1531 </D:prop>
1532 <C:filter test="anyof">
1533 <C:prop-filter name="FN">
1534 <C:text-match collation="i;unicode-casemap"
1535 match-type="contains"
1536 >daboo</C:text-match>
1537 </C:prop-filter>
1538 <C:prop-filter name="EMAIL">
1539 <C:text-match collation="i;unicode-casemap"
1540 match-type="contains"
1541 >daboo</C:text-match>
1542 </C:prop-filter>
1543 </C:filter>
1544 </C:addressbook-query>
1545
1546 >> Response <<
1547
1548 HTTP/1.1 207 Multi-Status
1549 Date: Sat, 11 Nov 2006 09:32:12 GMT
1550 Content-Type: text/xml; charset="utf-8"
1551 Content-Length: xxxx
1552
1553 <?xml version="1.0" encoding="utf-8" ?>
1554 <D:multistatus xmlns:D="DAV:"
1555 xmlns:C="urn:ietf:params:xml:ns:carddav">
1556 <D:response>
1557 <D:href>/home/bernard/addressbook/v102.vcf</D:href>
1558 <D:propstat>
1559 <D:prop>
1560 <D:getetag>"23ba4d-ff11fb"</D:getetag>
1561 <C:address-data>BEGIN:VCARD
1562 VERSION:3.0
1563 NICKNAME:me
1564 UID:34222-232@example.com
1565 FN:David Boo
1566 EMAIL:daboo@example.com
1567
1568
1569
1570Daboo Standards Track [Page 28]
1571
1572RFC 6352 CardDAV August 2011
1573
1574
1575 END:VCARD
1576 </C:address-data>
1577 </D:prop>
1578 <D:status>HTTP/1.1 200 OK</D:status>
1579 </D:propstat>
1580 </D:response>
1581 <D:response>
1582 <D:href>/home/bernard/addressbook/v104.vcf</D:href>
1583 <D:propstat>
1584 <D:prop>
1585 <D:getetag>"23ba4d-ff11fc"</D:getetag>
1586 <C:address-data>BEGIN:VCARD
1587 VERSION:3.0
1588 NICKNAME:oliver
1589 UID:34222-23222@example.com
1590 FN:Oliver Daboo
1591 EMAIL:oliver@example.com
1592 END:VCARD
1593 </C:address-data>
1594 </D:prop>
1595 <D:status>HTTP/1.1 200 OK</D:status>
1596 </D:propstat>
1597 </D:response>
1598 </D:multistatus>
1599
16008.6.5. Example: Truncated Results
1601
1602 In this example, the client requests that the server search for
1603 address object resources that contain a FN property whose value
1604 contains some specific text and return the DAV:getetag property for
1605 two results only. The server response includes a 507 status for the
1606 Request-URI indicating that there were more than two resources that
1607 matched the query, but that the server truncated the result set as
1608 requested by the client.
1609
1610 >> Request <<
1611
1612 REPORT /home/bernard/addressbook/ HTTP/1.1
1613 Host: addressbook.example.com
1614 Depth: 1
1615 Content-Type: text/xml; charset="utf-8"
1616 Content-Length: xxxx
1617
1618 <?xml version="1.0" encoding="utf-8" ?>
1619 <C:addressbook-query xmlns:D="DAV:"
1620 xmlns:C="urn:ietf:params:xml:ns:carddav">
1621
1622
1623
1624
1625
1626Daboo Standards Track [Page 29]
1627
1628RFC 6352 CardDAV August 2011
1629
1630
1631 <D:prop>
1632 <D:getetag/>
1633 </D:prop>
1634 <C:filter test="anyof">
1635 <C:prop-filter name="FN">
1636 <C:text-match collation="i;unicode-casemap"
1637 match-type="contains"
1638 >daboo</C:text-match>
1639 </C:prop-filter>
1640 </C:filter>
1641 <C:limit>
1642 <C:nresults>2</C:nresults>
1643 </C:limit>
1644 </C:addressbook-query>
1645
1646 >> Response <<
1647
1648 HTTP/1.1 207 Multi-Status
1649 Date: Sat, 11 Nov 2006 09:32:12 GMT
1650 Content-Type: text/xml; charset="utf-8"
1651 Content-Length: xxxx
1652
1653 <?xml version="1.0" encoding="utf-8" ?>
1654 <D:multistatus xmlns:D="DAV:"
1655 xmlns:C="urn:ietf:params:xml:ns:carddav">
1656 <D:response>
1657 <D:href>/home/bernard/addressbook/</D:href>
1658 <D:status>HTTP/1.1 507 Insufficient Storage</D:status>
1659 <D:error><D:number-of-matches-within-limits/></D:error>
1660 <D:responsedescription xml:lang="en">
1661 Only two matching records were returned
1662 </D:responsedescription>
1663 </D:response>
1664 <D:response>
1665 <D:href>/home/bernard/addressbook/v102.vcf</D:href>
1666 <D:propstat>
1667 <D:prop>
1668 <D:getetag>"23ba4d-ff11fb"</D:getetag>
1669 </D:prop>
1670 <D:status>HTTP/1.1 200 OK</D:status>
1671 </D:propstat>
1672 </D:response>
1673 <D:response>
1674 <D:href>/home/bernard/addressbook/v104.vcf</D:href>
1675 <D:propstat>
1676 <D:prop>
1677 <D:getetag>"23ba4d-ff11fc"</D:getetag>
1678 </D:prop>
1679
1680
1681
1682Daboo Standards Track [Page 30]
1683
1684RFC 6352 CardDAV August 2011
1685
1686
1687 <D:status>HTTP/1.1 200 OK</D:status>
1688 </D:propstat>
1689 </D:response>
1690 </D:multistatus>
1691
16928.7. CARDDAV:addressbook-multiget Report
1693
1694 The CARDDAV:addressbook-multiget REPORT is used to retrieve specific
1695 address object resources from within a collection, if the Request-URI
1696 is a collection, or to retrieve a specific address object resource,
1697 if the Request-URI is an address object resource. This report is
1698 similar to the CARDDAV:addressbook-query REPORT (see Section 8.6),
1699 except that it takes a list of DAV:href elements instead of a
1700 CARDDAV:filter element to determine which address object resources to
1701 return.
1702
1703 Support for the addressbook-multiget REPORT is REQUIRED.
1704
1705 Marshalling:
1706
1707 The request body MUST be a CARDDAV:addressbook-multiget XML
1708 element (see Section 10.7), which MUST contain at least one
1709 DAV:href XML element and one optional CARDDAV:address-data element
1710 as defined in Section 10.4. If DAV:href elements are present, the
1711 scope of the request is the set of resources identified by these
1712 elements, which all need to be members (not necessarily internal
1713 members) of the resource identified by the Request-URI.
1714 Otherwise, the scope is the resource identified by the Request-URI
1715 itself.
1716
1717 The request MUST include a Depth: 0 header; however, the actual
1718 scope of the REPORT is determined as described above.
1719
1720 The response body for a successful request MUST be a
1721 DAV:multistatus XML element.
1722
1723 The response body for a successful CARDDAV:addressbook-multiget
1724 REPORT request MUST contain a DAV:response element for each
1725 address object resource referenced by the provided set of DAV:href
1726 elements. Address data is returned in the CARDDAV:address-data
1727 element inside the DAV:prop element.
1728
1729 In the case of an error accessing any of the provided DAV:href
1730 resources, the server MUST return the appropriate error status
1731 code in the DAV:status element of the corresponding DAV:response
1732 element.
1733
1734
1735
1736
1737
1738Daboo Standards Track [Page 31]
1739
1740RFC 6352 CardDAV August 2011
1741
1742
1743 Preconditions:
1744
1745 (CARDDAV:supported-address-data): The attributes "content-type"
1746 and "version" of the CARDDAV:address-data XML elements (see
1747 Section 10.4) specify a media type supported by the server for
1748 address object resources.
1749
1750 Postconditions:
1751
1752 None.
1753
17548.7.1. Example: CARDDAV:addressbook-multiget Report
1755
1756 In this example, the client requests the server to return specific
1757 vCard properties of the address components referenced by specific
1758 URIs. In addition, the DAV:getetag property is also requested and
1759 returned as part of the response. Note that, in this example, the
1760 resource at
1761 http://addressbook.example.com/home/bernard/addressbook/vcf1.vcf does
1762 not exist, resulting in an error status response.
1763
1764 >> Request <<
1765
1766 REPORT /home/bernard/addressbook/ HTTP/1.1
1767 Host: addressbook.example.com
1768 Depth: 1
1769 Content-Type: text/xml; charset="utf-8"
1770 Content-Length: xxxx
1771
1772 <?xml version="1.0" encoding="utf-8" ?>
1773 <C:addressbook-multiget xmlns:D="DAV:"
1774 xmlns:C="urn:ietf:params:xml:ns:carddav">
1775 <D:prop>
1776 <D:getetag/>
1777 <C:address-data>
1778 <C:prop name="VERSION"/>
1779 <C:prop name="UID"/>
1780 <C:prop name="NICKNAME"/>
1781 <C:prop name="EMAIL"/>
1782 <C:prop name="FN"/>
1783 </C:address-data>
1784 </D:prop>
1785 <D:href>/home/bernard/addressbook/vcf102.vcf</D:href>
1786 <D:href>/home/bernard/addressbook/vcf1.vcf</D:href>
1787 </C:addressbook-multiget>
1788
1789
1790
1791
1792
1793
1794Daboo Standards Track [Page 32]
1795
1796RFC 6352 CardDAV August 2011
1797
1798
1799 >> Response <<
1800
1801 HTTP/1.1 207 Multi-Status
1802 Date: Sat, 11 Nov 2006 09:32:12 GMT
1803 Content-Type: text/xml; charset="utf-8"
1804 Content-Length: xxxx
1805
1806 <?xml version="1.0" encoding="utf-8" ?>
1807 <D:multistatus xmlns:D="DAV:"
1808 xmlns:C="urn:ietf:params:xml:ns:carddav">
1809 <D:response>
1810 <D:href>/home/bernard/addressbook/vcf102.vcf</D:href>
1811 <D:propstat>
1812 <D:prop>
1813 <D:getetag>"23ba4d-ff11fb"</D:getetag>
1814 <C:address-data>BEGIN:VCARD
1815 VERSION:3.0
1816 NICKNAME:me
1817 UID:34222-232@example.com
1818 FN:Cyrus Daboo
1819 EMAIL:daboo@example.com
1820 END:VCARD
1821 </C:address-data>
1822 </D:prop>
1823 <D:status>HTTP/1.1 200 OK</D:status>
1824 </D:propstat>
1825 </D:response>
1826 <D:response>
1827 <D:href>/home/bernard/addressbook/vcf1.vcf</D:href>
1828 <D:status>HTTP/1.1 404 Resource not found</D:status>
1829 </D:response>
1830 </D:multistatus>
1831
18328.7.2. Example: CARDDAV:addressbook-multiget Report
1833
1834 In this example, the client requests the server to return vCard v4.0
1835 data of the address components referenced by specific URIs. In
1836 addition, the DAV:getetag property is also requested and returned as
1837 part of the response. Note that, in this example, the resource at
1838 http://addressbook.example.com/home/bernard/addressbook/vcf3.vcf
1839 exists but in a media type format that the server is unable to
1840 convert, resulting in an error status response.
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850Daboo Standards Track [Page 33]
1851
1852RFC 6352 CardDAV August 2011
1853
1854
1855 >> Request <<
1856
1857 REPORT /home/bernard/addressbook/ HTTP/1.1
1858 Host: addressbook.example.com
1859 Depth: 1
1860 Content-Type: text/xml; charset="utf-8"
1861 Content-Length: xxxx
1862
1863 <?xml version="1.0" encoding="utf-8" ?>
1864 <C:addressbook-multiget xmlns:D="DAV:"
1865 xmlns:C="urn:ietf:params:xml:ns:carddav">
1866 <D:prop>
1867 <D:getetag/>
1868 <C:address-data content-type='text/vcard' version='4.0'/>
1869 </D:prop>
1870 <D:href>/home/bernard/addressbook/vcf3.vcf</D:href>
1871 </C:addressbook-multiget>
1872
1873 >> Response <<
1874
1875 HTTP/1.1 207 Multi-Status
1876 Date: Sat, 11 Nov 2006 09:32:12 GMT
1877 Content-Type: text/xml; charset="utf-8"
1878 Content-Length: xxxx
1879
1880 <?xml version="1.0" encoding="utf-8" ?>
1881 <D:multistatus xmlns:D="DAV:"
1882 xmlns:C="urn:ietf:params:xml:ns:carddav">
1883 <D:response>
1884 <D:href>/home/bernard/addressbook/vcf3.vcf</D:href>
1885 <D:status>HTTP/1.1 415 Unsupported Media Type</D:status>
1886 <D:error><C:supported-address-data-conversion/></D:error>
1887 <D:responsedescription>Unable to convert from vCard v3.0
1888 to vCard v4.0</D:responsedescription>
1889 </D:response>
1890 </D:multistatus>
1891
18929. Client Guidelines
1893
18949.1. Restrict the Properties Returned
1895
1896 Clients may not need all the properties in a vCard object when
1897 presenting information to the user, or looking up specific items for
1898 their email address, for example. Since some property data can be
1899 large (e.g., PHOTO or SOUND with in-line content) clients can choose
1900 to ignore those by only requesting the specific items it knows it
1901 will use, through use of the CARDDAV:address-data XML element in the
1902 relevant reports.
1903
1904
1905
1906Daboo Standards Track [Page 34]
1907
1908RFC 6352 CardDAV August 2011
1909
1910
1911 However, if a client needs to make a change to a vCard, it can only
1912 change the entire vCard data via a PUT request. There is no way to
1913 incrementally make a change to a set of properties within a vCard
1914 object resource. As a result, the client will have to cache the
1915 entire set of properties on a resource that is being changed.
1916
19179.2. Avoiding Lost Updates
1918
1919 When resources are accessed by multiple clients, the possibility of
1920 clients overwriting each other's changes exists. To alleviate this,
1921 clients SHOULD use the If-Match request header on PUT requests with
1922 the ETag of the previously retrieved resource data to check whether
1923 the resource was modified since it was previously retrieved. If a
1924 precondition failure occurs, clients need to reload the resource and
1925 go through their own merge or conflict resolution process before
1926 writing back the data (again using the If-Match check).
1927
19289.3. Client Configuration
1929
1930 When CardDAV clients need to be configured, the key piece of
1931 information that they require is the principal-URL of the user whose
1932 address book information is desired. Servers SHOULD support the
1933 DAV:current-user-principal-URL property as defined in [RFC5397] to
1934 give clients a fast way to locate user principals.
1935
1936 Given support for SRV records (Section 11) and DAV:current-user-
1937 principal-URL [RFC5397], users only need enter a user identifier,
1938 host name, and password to configure their client. The client would
1939 take the host name and do an SRV lookup to locate the CardDAV server,
1940 then execute an authenticated PROPFIND on the root/resource looking
1941 for the DAV:current-user-principal-URL property. The value returned
1942 gives the client direct access to the user's principal-URL and from
1943 there all the related CardDAV properties needed to locate address
1944 books.
1945
19469.4. Finding Other Users' Address Books
1947
1948 For use cases of address book sharing, one might wish to find the
1949 address book belonging to another user. To find other users' address
1950 books on the same server, the DAV:principal-property-search REPORT
1951 [RFC3744] can be used to search principals for matching properties
1952 and return specified properties for the matching principal resources.
1953 To search for an address book owned by a user named "Laurie", the
1954 REPORT request body would look like this:
1955
1956
1957
1958
1959
1960
1961
1962Daboo Standards Track [Page 35]
1963
1964RFC 6352 CardDAV August 2011
1965
1966
1967 <?xml version="1.0" encoding="utf-8" ?>
1968 <D:principal-property-search xmlns:D="DAV:">
1969 <D:property-search>
1970 <D:prop>
1971 <D:displayname/>
1972 </D:prop>
1973 <D:match>Laurie</D:match>
1974 </D:property-search>
1975 <D:prop>
1976 <C:addressbook-home-set
1977 xmlns:C="urn:ietf:params:xml:ns:carddav"/>
1978 <D:displayname/>
1979 </D:prop>
1980 </D:principal-property-search>
1981
1982 The server performs a case-sensitive or caseless search for a
1983 matching string subset of "Laurie" within the DAV:displayname
1984 property. Thus, the server might return "Laurie Dusseault", "Laurier
1985 Desruisseaux", or "Wilfrid Laurier" all as matching DAV:displayname
1986 values, and the address books for each of these.
1987
198810. XML Element Definitions
1989
199010.1. CARDDAV:addressbook XML Element
1991
1992 Name: addressbook
1993
1994 Namespace: urn:ietf:params:xml:ns:carddav
1995
1996 Purpose: Specifies the resource type of an address book collection.
1997
1998 Description: See Section 5.2.
1999
2000 Definition:
2001
2002 <!ELEMENT addressbook EMPTY>
2003
200410.2. CARDDAV:supported-collation XML Element
2005
2006 Name: supported-collation
2007
2008 Namespace: urn:ietf:params:xml:ns:carddav
2009
2010 Purpose: Identifies a single collation via its collation identifier
2011 as defined by [RFC4790].
2012
2013 Description: The CARDDAV:supported-collation contains the text of a
2014 collation identifier as described in Section 8.3.1.
2015
2016
2017
2018Daboo Standards Track [Page 36]
2019
2020RFC 6352 CardDAV August 2011
2021
2022
2023 Definition:
2024
2025 <!ELEMENT supported-collation (#PCDATA)>
2026 <!-- PCDATA value: collation identifier -->
2027
202810.3. CARDDAV:addressbook-query XML Element
2029
2030 Name: addressbook-query
2031
2032 Namespace: urn:ietf:params:xml:ns:carddav
2033
2034 Purpose: Defines a report for querying address book data
2035
2036 Description: See Section 8.6.
2037
2038 Definition:
2039
2040 <!ELEMENT addressbook-query ((DAV:allprop |
2041 DAV:propname |
2042 DAV:prop)?, filter, limit?)>
2043
204410.4. CARDDAV:address-data XML Element
2045
2046 Name: address-data
2047
2048 Namespace: urn:ietf:params:xml:ns:carddav
2049
2050 Purpose: Specifies one of the following:
2051
2052 1. The parts of an address object resource that should be
2053 returned by a given address book REPORT request, and the media
2054 type and version for the returned data; or
2055
2056 2. The content of an address object resource in a response to an
2057 address book REPORT request.
2058
2059 Description: When used in an address book REPORT request, the
2060 CARDDAV:address-data XML element specifies which parts of address
2061 object resources need to be returned in the response. If the
2062 CARDDAV:address-data XML element doesn't contain any CARDDAV:prop
2063 elements, address object resources will be returned in their
2064 entirety. Additionally, a media type and version can be specified
2065 to request that the server return the data in that format if
2066 possible.
2067
2068 Finally, when used in an address book REPORT response, the
2069 CARDDAV:address-data XML element specifies the content of an
2070 address object resource. Given that XML parsers normalize the
2071
2072
2073
2074Daboo Standards Track [Page 37]
2075
2076RFC 6352 CardDAV August 2011
2077
2078
2079 two-character sequence CRLF (US-ASCII decimal 13 and US-ASCII
2080 decimal 10) to a single LF character (US-ASCII decimal 10), the CR
2081 character (US-ASCII decimal 13) MAY be omitted in address object
2082 resources specified in the CARDDAV:address-data XML element.
2083 Furthermore, address object resources specified in the
2084 CARDDAV:address-data XML element MAY be invalid per their media
2085 type specification if the CARDDAV:address-data XML element part of
2086 the address book REPORT request did not specify required vCard
2087 properties (e.g., UID, etc.) or specified a CARDDAV:prop XML
2088 element with the "novalue" attribute set to "yes".
2089
2090 Note: The CARDDAV:address-data XML element is specified in requests
2091 and responses inside the DAV:prop XML element as if it were a
2092 WebDAV property. However, the CARDDAV:address-data XML element is
2093 not a WebDAV property and as such it is not returned in PROPFIND
2094 responses nor used in PROPPATCH requests.
2095
2096 Note: The address data embedded within the CARDDAV:address-data XML
2097 element MUST follow the standard XML character data encoding
2098 rules, including use of &lt;, &gt;, &amp; etc., entity encoding or
2099 the use of a <![CDATA[ ... ]]> construct. In the latter case, the
2100 vCard data cannot contain the character sequence "]]>", which is
2101 the end delimiter for the CDATA section.
2102
2103 Definition:
2104
2105 <!ELEMENT address-data (allprop | prop*)>
2106
2107 when nested in the DAV:prop XML element in an address book
2108 REPORT request to specify which parts of address object
2109 resources should be returned in the response;
2110
2111 <!ELEMENT address-data (#PCDATA)>
2112 <!-- PCDATA value: address data -->
2113
2114 when nested in the DAV:prop XML element in an address book
2115 REPORT response to specify the content of a returned
2116 address object resource.
2117
2118 <!ATTLIST address-data content-type CDATA "text/vcard"
2119 version CDATA "3.0">
2120 <!-- content-type value: a MIME media type -->
2121 <!-- version value: a version string -->
2122
2123 attributes can be used on each variant of the
2124 CALDAV:address-data XML element.
2125
2126
2127
2128
2129
2130Daboo Standards Track [Page 38]
2131
2132RFC 6352 CardDAV August 2011
2133
2134
213510.4.1. CARDDAV:allprop XML Element
2136
2137 Name: allprop
2138
2139 Namespace: urn:ietf:params:xml:ns:carddav
2140
2141 Purpose: Specifies that all vCard properties shall be returned.
2142
2143 Description: This element can be used when the client wants all
2144 vCard properties of components returned by a report.
2145
2146 Definition:
2147
2148 <!ELEMENT allprop EMPTY>
2149
2150 Note: The CARDDAV:allprop element defined here has the same name as
2151 the DAV:allprop element defined in WebDAV. However, the
2152 CARDDAV:allprop element defined here uses the
2153 "urn:ietf:params:xml:ns:carddav" namespace, as opposed to the "DAV:"
2154 namespace used for the DAV:allprop element defined in WebDAV.
2155
215610.4.2. CARDDAV:prop XML Element
2157
2158 Name: prop
2159
2160 Namespace: urn:ietf:params:xml:ns:carddav
2161
2162 Purpose: Defines which vCard properties to return in the response.
2163
2164 Description: The "name" attribute specifies the name of the vCard
2165 property to return (e.g., "NICKNAME"). The "novalue" attribute
2166 can be used by clients to request that the actual value of the
2167 property not be returned (if the "novalue" attribute is set to
2168 "yes"). In that case, the server will return just the vCard
2169 property name and any vCard parameters and a trailing ":" without
2170 the subsequent value data.
2171
2172 vCard allows a "group" prefix to appear before a property name in
2173 the vCard data. When the "name" attribute does not specify a
2174 group prefix, it MUST match properties in the vCard data without a
2175 group prefix or with any group prefix. When the "name" attribute
2176 includes a group prefix, it MUST match properties that have
2177 exactly the same group prefix and name. For example, a "name" set
2178 to "TEL" will match "TEL", "X-ABC.TEL", and "X-ABC-1.TEL" vCard
2179 properties. A "name" set to "X-ABC.TEL" will match an "X-ABC.TEL"
2180 vCard property only; it will not match "TEL" or "X-ABC-1.TEL".
2181
2182
2183
2184
2185
2186Daboo Standards Track [Page 39]
2187
2188RFC 6352 CardDAV August 2011
2189
2190
2191 Definition:
2192
2193 <!ELEMENT prop EMPTY>
2194
2195 <!ATTLIST prop name CDATA #REQUIRED
2196 novalue (yes | no) "no">
2197 <!-- name value: a vCard property name -->
2198 <!-- novalue value: "yes" or "no" -->
2199
2200 Note: The CARDDAV:prop element defined here has the same name as the
2201 DAV:prop element defined in WebDAV. However, the CARDDAV:prop
2202 element defined here uses the "urn:ietf:params:xml:ns:carddav"
2203 namespace, as opposed to the "DAV:" namespace used for the DAV:prop
2204 element defined in WebDAV.
2205
220610.5. CARDDAV:filter XML Element
2207
2208 Name: filter
2209
2210 Namespace: urn:ietf:params:xml:ns:carddav
2211
2212 Purpose: Determines which matching objects are returned.
2213
2214 Description: The "filter" element specifies the search filter used
2215 to match address objects that should be returned by a report. The
2216 "test" attribute specifies whether any (logical OR) or all
2217 (logical AND) of the prop-filter tests need to match in order for
2218 the overall filter to match.
2219
2220 Definition:
2221
2222 <!ELEMENT filter (prop-filter*)>
2223
2224 <!ATTLIST filter test (anyof | allof) "anyof">
2225 <!-- test value:
2226 anyof logical OR for prop-filter matches
2227 allof logical AND for prop-filter matches -->
2228
222910.5.1. CARDDAV:prop-filter XML Element
2230
2231 Name: prop-filter
2232
2233 Namespace: urn:ietf:params:xml:ns:carddav
2234
2235 Purpose: Limits the search to specific vCard properties.
2236
2237
2238
2239
2240
2241
2242Daboo Standards Track [Page 40]
2243
2244RFC 6352 CardDAV August 2011
2245
2246
2247 Description: The CARDDAV:prop-filter XML element specifies search
2248 criteria on a specific vCard property (e.g., "NICKNAME"). An
2249 address object is said to match a CARDDAV:prop-filter if:
2250
2251 * A vCard property of the type specified by the "name" attribute
2252 exists, and the CARDDAV:prop-filter is empty, or it matches any
2253 specified CARDDAV:text-match or CARDDAV:param-filter
2254 conditions. The "test" attribute specifies whether any
2255 (logical OR) or all (logical AND) of the text-filter and param-
2256 filter tests need to match in order for the overall filter to
2257 match.
2258
2259 or:
2260
2261 * A vCard property of the type specified by the "name" attribute
2262 does not exist, and the CARDDAV:is-not-defined element is
2263 specified.
2264
2265 vCard allows a "group" prefix to appear before a property name in
2266 the vCard data. When the "name" attribute does not specify a
2267 group prefix, it MUST match properties in the vCard data without a
2268 group prefix or with any group prefix. When the "name" attribute
2269 includes a group prefix, it MUST match properties that have
2270 exactly the same group prefix and name. For example, a "name" set
2271 to "TEL" will match "TEL", "X-ABC.TEL", "X-ABC-1.TEL" vCard
2272 properties. A "name" set to "X-ABC.TEL" will match an "X-ABC.TEL"
2273 vCard property only, it will not match "TEL" or "X-ABC-1.TEL".
2274
2275 Definition:
2276
2277 <!ELEMENT prop-filter (is-not-defined |
2278 (text-match*, param-filter*))>
2279
2280 <!ATTLIST prop-filter name CDATA #REQUIRED
2281 test (anyof | allof) "anyof">
2282 <!-- name value: a vCard property name (e.g., "NICKNAME")
2283 test value:
2284 anyof logical OR for text-match/param-filter matches
2285 allof logical AND for text-match/param-filter matches -->
2286
228710.5.2. CARDDAV:param-filter XML Element
2288
2289 Name: param-filter
2290
2291 Namespace: urn:ietf:params:xml:ns:carddav
2292
2293 Purpose: Limits the search to specific parameter values.
2294
2295
2296
2297
2298Daboo Standards Track [Page 41]
2299
2300RFC 6352 CardDAV August 2011
2301
2302
2303 Description: The CARDDAV:param-filter XML element specifies search
2304 criteria on a specific vCard property parameter (e.g., TYPE) in
2305 the scope of a given CARDDAV:prop-filter. A vCard property is
2306 said to match a CARDDAV:param-filter if:
2307
2308 * A parameter of the type specified by the "name" attribute
2309 exists, and the CARDDAV:param-filter is empty, or it matches
2310 the CARDDAV:text-match conditions if specified.
2311
2312 or:
2313
2314 * A parameter of the type specified by the "name" attribute does
2315 not exist, and the CARDDAV:is-not-defined element is specified.
2316
2317 Definition:
2318
2319 <!ELEMENT param-filter (is-not-defined | text-match)?>
2320
2321 <!ATTLIST param-filter name CDATA #REQUIRED>
2322 <!-- name value: a property parameter name (e.g., "TYPE") -->
2323
232410.5.3. CARDDAV:is-not-defined XML Element
2325
2326 Name: is-not-defined
2327
2328 Namespace: urn:ietf:params:xml:ns:carddav
2329
2330 Purpose: Specifies that a match should occur if the enclosing vCard
2331 property or parameter does not exist.
2332
2333 Description: The CARDDAV:is-not-defined XML element specifies that a
2334 match occurs if the enclosing vCard property or parameter value
2335 specified in an address book REPORT request does not exist in the
2336 address data being tested.
2337
2338 Definition:
2339
2340 <!ELEMENT is-not-defined EMPTY>
2341
234210.5.4. CARDDAV:text-match XML Element
2343
2344 Name: text-match
2345
2346 Namespace: urn:ietf:params:xml:ns:carddav
2347
2348 Purpose: Specifies a substring match on a vCard property or
2349 parameter value.
2350
2351
2352
2353
2354Daboo Standards Track [Page 42]
2355
2356RFC 6352 CardDAV August 2011
2357
2358
2359 Description: The CARDDAV:text-match XML element specifies text used
2360 for a substring match against the vCard property or parameter
2361 value specified in an address book REPORT request.
2362
2363 The "collation" attribute is used to select the collation that the
2364 server MUST use for character string matching. In the absence of
2365 this attribute, the server MUST use the "i;unicode-casemap"
2366 collation.
2367
2368 The "negate-condition" attribute is used to indicate that this
2369 test returns a match if the text matches, when the attribute value
2370 is set to "no", or return a match if the text does not match, if
2371 the attribute value is set to "yes". For example, this can be
2372 used to match components with a CATEGORIES property not set to
2373 PERSON.
2374
2375 The "match-type" attribute is used to indicate the type of match
2376 operation to use. Possible choices are:
2377
2378 "equals" - an exact match to the target string
2379
2380 "contains" - a substring match, matching anywhere within the
2381 target string
2382
2383 "starts-with" - a substring match, matching only at the start
2384 of the target string
2385
2386 "ends-with" - a substring match, matching only at the end of
2387 the target string
2388
2389 Definition:
2390
2391 <!ELEMENT text-match (#PCDATA)>
2392 <!-- PCDATA value: string -->
2393
2394 <!ATTLIST text-match
2395 collation CDATA "i;unicode-casemap"
2396 negate-condition (yes | no) "no"
2397 match-type (equals|contains|starts-with|ends-with) "contains">
2398
239910.6. CARDDAV:limit XML Element
2400
2401 Name: limit
2402
2403 Namespace: urn:ietf:params:xml:ns:carddav
2404
2405 Purpose: Specifies different types of limits that can be applied to
2406 the results returned by the server.
2407
2408
2409
2410Daboo Standards Track [Page 43]
2411
2412RFC 6352 CardDAV August 2011
2413
2414
2415 Description: The CARDDAV:limit XML element can be used to specify
2416 different types of limits that the client can request the server
2417 to apply to the results returned by the server. Currently, only
2418 the CARDDAV:nresults limit can be used; other types of limit could
2419 be defined in the future.
2420
2421 Definition:
2422
2423 <!ELEMENT limit (nresults)>
2424
242510.6.1. CARDDAV:nresults XML Element
2426
2427 Name: nresults
2428
2429 Namespace: urn:ietf:params:xml:ns:carddav
2430
2431 Purpose: Specifies a limit on the number of results returned by the
2432 server.
2433
2434 Description: The CARDDAV:nresults XML element contains a requested
2435 maximum number of DAV:response elements to be returned in the
2436 response body of a query. The server MAY disregard this limit.
2437 The value of this element is an unsigned integer.
2438
2439 Definition:
2440
2441 <!ELEMENT nresults (#PCDATA)>
2442 <!-- nresults value: unsigned integer, must be digits -->
2443
244410.7. CARDDAV:addressbook-multiget XML Element
2445
2446 Name: addressbook-multiget
2447
2448 Namespace: urn:ietf:params:xml:ns:carddav
2449
2450 Purpose: CardDAV report used to retrieve specific address objects
2451 via their URIs.
2452
2453 Description: See Section 8.7.
2454
2455 Definition:
2456
2457 <!ELEMENT addressbook-multiget ((DAV:allprop |
2458 DAV:propname |
2459 DAV:prop)?,
2460 DAV:href+)>
2461
2462
2463
2464
2465
2466Daboo Standards Track [Page 44]
2467
2468RFC 6352 CardDAV August 2011
2469
2470
247111. Service Discovery via SRV Records
2472
2473 [RFC2782] defines a DNS-based service discovery protocol that has
2474 been widely adopted as a means of locating particular services within
2475 a local area network and beyond, using SRV RRs.
2476
2477 This specification adds two service types for use with SRV records:
2478
2479 carddav: Identifies a CardDAV server that uses HTTP without TLS
2480 [RFC2818].
2481
2482 carddavs: Identifies a CardDAV server that uses HTTP with TLS
2483 [RFC2818].
2484
2485 Example: non-TLS service record
2486
2487 _carddav._tcp SRV 0 1 80 addressbook.example.com.
2488
2489 Example: TLS service
2490
2491 _carddavs._tcp SRV 0 1 443 addressbook.example.com.
2492
249312. Internationalization Considerations
2494
2495 CardDAV allows internationalized strings to be stored and retrieved
2496 for the description of address book collections (see Section 6.2.1).
2497
2498 The CARDDAV:addressbook-query REPORT (Section 8.6) includes a text
2499 searching option controlled by the CARDDAV:text-match element and
2500 details of character handling are covered in the description of that
2501 element (see Section 10.5.4).
2502
250313. Security Considerations
2504
2505 HTTP protocol transactions are sent in the clear over the network
2506 unless protection from snooping is negotiated. This can be
2507 accomplished by use of TLS as defined in [RFC2818]. In particular,
2508 if HTTP Basic authentication [RFC2617] is available, the server MUST
2509 allow TLS to be used at the same time, and it SHOULD prevent use of
2510 Basic authentication when TLS is not in use. Clients SHOULD use TLS
2511 whenever possible.
2512
2513 With the ACL extension [RFC3744] present, WebDAV allows control over
2514 who can access (read or write) any resource on the WebDAV server. In
2515 addition, WebDAV ACL provides for an "inheritance" mechanism, whereby
2516 resources may inherit access privileges from other resources. Often,
2517 the "other" resource is a parent collection of the resource itself.
2518 Servers are able to support address books that are "private"
2519
2520
2521
2522Daboo Standards Track [Page 45]
2523
2524RFC 6352 CardDAV August 2011
2525
2526
2527 (accessible only to the "owner"), "shared" (accessible to the owner
2528 and other specified authenticated users), and "public" (accessible to
2529 any authenticated or unauthenticated users). When provisioning
2530 address books of a particular type, servers MUST ensure that the
2531 correct privileges are applied on creation. In particular, private
2532 and shared address books MUST NOT be accessible by unauthenticated
2533 users (to prevent data from being automatically searched or indexed
2534 by web "crawlers").
2535
2536 Clients SHOULD warn users in an appropriate fashion when they copy or
2537 move address data from a private address book to a shared address
2538 book or public address book. Clients SHOULD provide a clear
2539 indication as to which address books are private, shared, or public.
2540 Clients SHOULD provide an appropriate warning when changing access
2541 privileges for a private or shared address book with data so as to
2542 allow unauthenticated users access.
2543
2544 This specification currently relies on standard HTTP authentication
2545 mechanisms for identifying users. These comprise Basic and Digest
2546 authentication [RFC2617] as well as TLS [RFC2818] using client-side
2547 certificates.
2548
254914. IANA Consideration
2550
2551 This document uses a URN to describe a new XML namespace conforming
2552 to the registry mechanism described in [RFC3688].
2553
255414.1. Namespace Registration
2555
2556 Registration request for the carddav namespace:
2557
2558 URI: urn:ietf:params:xml:ns:carddav
2559
2560 Registrant Contact: The IESG <iesg@ietf.org>
2561
2562 XML: None - not applicable for namespace registrations.
2563
256415. Acknowledgments
2565
2566 Thanks go to Lisa Dusseault and Bernard Desruisseaux for their work
2567 on CalDAV, on which CardDAV is heavily based. The following
2568 individuals contributed their ideas and support for writing this
2569 specification: Mike Douglass, Stefan Eissing, Helge Hess, Arnaud
2570 Quillaud, Julian Reschke, Elias Sinderson, Greg Stein, Wilfredo
2571 Sanchez, and Simon Vaillancourt.
2572
2573
2574
2575
2576
2577
2578Daboo Standards Track [Page 46]
2579
2580RFC 6352 CardDAV August 2011
2581
2582
258316. References
2584
258516.1. Normative References
2586
2587 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
2588 Requirement Levels", BCP 14, RFC 2119, March 1997.
2589
2590 [RFC2426] Dawson, F. and T. Howes, "vCard MIME Directory Profile",
2591 RFC 2426, September 1998.
2592
2593 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
2594 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
2595 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
2596
2597 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S.,
2598 Leach, P., Luotonen, A., and L. Stewart, "HTTP
2599 Authentication: Basic and Digest Access Authentication",
2600 RFC 2617, June 1999.
2601
2602 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for
2603 specifying the location of services (DNS SRV)", RFC 2782,
2604 February 2000.
2605
2606 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.
2607
2608 [RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C., and J.
2609 Whitehead, "Versioning Extensions to WebDAV
2610 (Web Distributed Authoring and Versioning)", RFC 3253,
2611 March 2002.
2612
2613 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
2614 January 2004.
2615
2616 [RFC3744] Clemm, G., Reschke, J., Sedlar, E., and J. Whitehead, "Web
2617 Distributed Authoring and Versioning (WebDAV)
2618 Access Control Protocol", RFC 3744, May 2004.
2619
2620 [RFC4790] Newman, C., Duerst, M., and A. Gulbrandsen, "Internet
2621 Application Protocol Collation Registry", RFC 4790,
2622 March 2007.
2623
2624 [RFC4918] Dusseault, L., "HTTP Extensions for Web Distributed
2625 Authoring and Versioning (WebDAV)", RFC 4918, June 2007.
2626
2627 [RFC5051] Crispin, M., "i;unicode-casemap - Simple Unicode Collation
2628 Algorithm", RFC 5051, October 2007.
2629
2630
2631
2632
2633
2634Daboo Standards Track [Page 47]
2635
2636RFC 6352 CardDAV August 2011
2637
2638
2639 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
2640 (TLS) Protocol Version 1.2", RFC 5246, August 2008.
2641
2642 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
2643 Housley, R., and W. Polk, "Internet X.509 Public Key
2644 Infrastructure Certificate and Certificate Revocation List
2645 (CRL) Profile", RFC 5280, May 2008.
2646
2647 [RFC5397] Sanchez, W. and C. Daboo, "WebDAV Current Principal
2648 Extension", RFC 5397, December 2008.
2649
2650 [RFC5689] Daboo, C., "Extended MKCOL for Web Distributed Authoring
2651 and Versioning (WebDAV)", RFC 5689, September 2009.
2652
2653 [RFC6350] Perreault, S., "vCard Format Specification", RFC 6350,
2654 August 2011.
2655
2656 [W3C.REC-xml-20081126]
2657 Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and
2658 F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth
2659 Edition)", World Wide Web Consortium Recommendation REC-
2660 xml-20081126, November 2008,
2661 <http://www.w3.org/TR/2008/REC-xml-20081126>.
2662
266316.2. Informative References
2664
2665 [IMSP] Myers, J., "IMSP - Internet Message Support Protocol",
2666 Work in Progress, June 1995.
2667
2668 [RFC2244] Newman, C. and J. Myers, "ACAP -- Application
2669 Configuration Access Protocol", RFC 2244, November 1997.
2670
2671 [RFC4510] Zeilenga, K., "Lightweight Directory Access Protocol
2672 (LDAP): Technical Specification Road Map", RFC 4510,
2673 June 2006.
2674
2675Author's Address
2676
2677 Cyrus Daboo
2678 Apple, Inc.
2679 1 Infinite Loop
2680 Cupertino, CA 95014
2681 USA
2682
2683 EMail: cyrus@daboo.name
2684 URI: http://www.apple.com/
2685
2686
2687
2688
2689
2690Daboo Standards Track [Page 48]
2691
2692