XEP-0292: vCard4 Over XMPP

Abstract:This document specifies an XMPP extension for use of the vCard4 XML format in XMPP systems, with the intent of obsoleting the vcard-temp format.
Authors:Samantha Mizzi, Peter Saint-Andre
Copyright:© 1999 - 2011 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Experimental
Type:Standards Track
Version:0.2
Last Updated:2011-04-07

WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.


Table of Contents


1. Introduction
2. Requirements
3. XML Namespace
4. Encapsulation
5. IQ-Based Publication and Retrieval
    5.1. Retrieval
    5.2. Publication
6. Event Notifications
    6.1. Location
    6.2. Subscribing to vCard Notifications
    6.3. Receiving a vCard Notification
7. vCards of Automated Entities
8. Mapping from vcard-temp to vCard4
    8.1. JABBERID
    8.2. DESC
9. Security Considerations
10. IANA Considerations
11. Open Issues
12. Acknowledgements

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

Since 1999, the Jabber/XMPP community has used an interim, unofficial XML representation of vCard data for personal contacts, called vcard-temp [1]. Recently, the IETF has upgraded vCard from vCard3 to vCard4 [2], and at the same time has defined vCard4 XML [3] as an official XML format for vCard4. This document specifies an XMPP extension for use of the vCard4 XML format in XMPP systems, with the intent of obsoleting the vcard-temp format. Primarily this document defines the encapsulation method itself; secondarily it also defines transport methods and a mapping to the vcard-temp format for migration by clients and servers.

2. Requirements

This specification was designed with the following requirements in mind.

  1. Reuse vCard4 as defined in draft-ietf-vcarddav-vcardrev.
  2. Reuse the vCard4 XML format as defined in draft-ietf-vcarddav-vcardxml.
  3. Ensure that clients and servers can easily migrate from vcard-temp to the new encapsulation format.
  4. Notify interested parties of changes to vCard data using standard XMPP extensions, specifically Personal Eventing Protocol [4].
  5. Support vCards for non-human entities such as XMPP servers and Multi-User Chat [5] rooms.
  6. Enable XMPP servers to store vCard4 XML data in LDAP directories if desired.

3. XML Namespace

Because there is now an XML namespace for the official vCard format, we can simply re-use that namespace: "urn:ietf:params:xml:ns:vcard-4.0".

4. Encapsulation

The vCard XML format defined at the IETF specifies that the root element is <vcards/>, where the only defined child element is <vcard/>. For use in XMPP, we specify that the root element shall be <vcard/>, not <vcards/>.

5. IQ-Based Publication and Retrieval

As in XEP-0054, the primary method for publishing and retrieving vCards is the XMPP <iq/> stanza.

5.1 Retrieval

An XMPP entity retrieves the vCard of another entity (or itself) by sending an IQ-get to the target entity containing a <vcard/> child element (note the lowercase "c"!) qualified by the 'urn:ietf:params:xml:ns:vcard-4.0' namespace.

Example 1. vCard Retrieval Request

<iq from='samizzi@cisco.com/foo'
    id='bx81v356'
    to='stpeter@jabber.org'
    type='get'>
  <vcard xmlns='urn:ietf:params:xml:ns:vcard-4.0'/>
</iq>
    

If a vCard exists for the target entity, the responsible entity (e.g., the XMPP server that hosts the account for a bare JID) MUST return the data in an IQ-result:

Example 2. Server Returns vCard

<iq from='stpeter@jabber.org'
    id='bx81v356'
    to='samizzi@cisco.com/foo'
    type='result'>
  <vcard xmlns='urn:ietf:params:xml:ns:vcard-4.0'>
    <fn><text>Peter Saint-Andre</text></fn>
    <n>
      <surname><text>Saint-Andre</text></surname>
      <given><text>Peter</text></given>
    </n>
    <nickname><text>stpeter</text></nickname>
    <url><uri>https://stpeter.im/</uri></url>
    <bday><date>19660806</date></bday>
    <gender><sex><text>M</text></sex></gender>
    <lang>
      <parameters><pref>1</pref></parameters>
      <language-tag>en</language-tag>
    </lang>
    <org>
      <parameters><type><text>work</text></type></parameters>
      <text>XMPP Standards Foundation</text>
    </org>
    <title><text>Executive Director</text></title>
    <role><text>Patron Saint</text></role>
    <adr>
      <parameters><type><text>work</text></type></parameters>
      <ext><text>Suite 600</text></ext>
      <street><text>1899 Wynkoop Street</text></street>
      <locality><text>Denver</text></locality>
      <region><text>CO</text></region>
      <code><text>80202</text></code>
      <country><text>USA</text></country>
    </adr>
    <adr>
      <parameters><type><text>home</text></type></parameters>
      <locality><text>Denver</text></locality>
      <region><text>CO</text></region>
      <code><text>80210</text></code>
      <country><text>USA</text></country>
    </adr>
    <tel>
      <parameters>
        <text>work</text>
        <text>voice</text>
      </parameters>
      <uri>tel:+1-303-308-3282</uri>
    </tel>
    <tel>
      <parameters>
        <text>home</text>
        <text>voice</text>
      </parameters>
      <uri>tel:+1-303-555-1212</uri>
    </tel>
    <email>
      <text>stpeter@jabber.org</text>
    </email>
    <impp>
      <uri>xmpp:stpeter@jabber.org</uri>
    </impp>
    <tz><text>America/Denver</text></tz>
  </vcard>
</iq>
    

If no vCard exists, the server MUST return an IQ-result containing an empty <vcard/> element.

Example 3. No vCard (empty element)

<iq from='stpeter@jabber.org'
    id='bx81v356'
    to='samizzi@cisco.com/foo'
    type='result'>
  <vcard xmlns='urn:ietf:params:xml:ns:vcard-4.0'/>
</iq>
    

5.2 Publication

An XMPP entity publishes or updates its vCard by sending an IQ-set to itself, containing a <vcard/> child element qualified by the 'urn:ietf:params:xml:ns:vcard-4.0' namespace.

Example 4. vCard Publication Request

<iq from='stpeter@jabber.org/squire
    id='h3vz319m'
    to='stpeter@jabber.org'
    type='set'>
  <vcard xmlns='urn:ietf:params:xml:ns:vcard-4.0'>
    <fn><text>Peter Saint-Andre</text></fn>
    <n>
      <surname><text>Saint-Andre</text></surname>
      <given><text>Peter</text></given>
    </n>
    <nickname><text>stpeter</text></nickname>
    <url><uri>https://stpeter.im/</uri></url>
    <bday><date>19660806</date></bday>
    <gender><sex><text>M</text></sex></gender>
    <lang>
      <parameters><pref>1</pref></parameters>
      <language-tag>en</language-tag>
    </lang>
    <org>
      <parameters><type><text>work</text></type></parameters>
      <text>XMPP Standards Foundation</text>
    </org>
    <title><text>Executive Director</text></title>
    <role><text>Patron Saint</text></role>
    <adr>
      <parameters><type><text>work</text></type></parameters>
      <ext><text>Suite 600</text></ext>
      <street><text>1899 Wynkoop Street</text></street>
      <locality><text>Denver</text></locality>
      <region><text>CO</text></region>
      <code><text>80202</text></code>
      <country><text>USA</text></country>
    </adr>
    <adr>
      <parameters><type><text>home</text></type></parameters>
      <locality><text>Denver</text></locality>
      <region><text>CO</text></region>
      <code><text>80210</text></code>
      <country><text>USA</text></country>
    </adr>
    <tel>
      <parameters>
        <text>work</text>
        <text>voice</text>
      </parameters>
      <uri>tel:+1-303-308-3282</uri>
    </tel>
    <tel>
      <parameters>
        <text>home</text>
        <text>voice</text>
      </parameters>
      <uri>tel:+1-303-555-1212</uri>
    </tel>
    <email>
      <parameters><type><text>work</text></type></parameters>
      <text>stpeter@jabber.org</text>
    </email>
    <impp>
      <parameters><type><text>work</text></type></parameters>
      <uri>xmpp:stpeter@jabber.org</uri>
    </impp>
    <key>
      <parameters><type><text>work</text></type></parameters>
      <uri>https://stpeter.im/index.php/contact/</uri>
    </key>
    <tz><text>America/Denver</text></tz>
  </vcard>
</iq>
    

If no error occurs, the responsible entity returns an IQ-result.

Example 5. Server Acknowledges Publication

<iq from='stpeter@jabber.org'
    id='bx81v356'
    to='stpeter@jabber.org/squire'
    type='result'/>
    

Note: An entity MAY have authorization to update the vCard of another entity (e.g., a server administrator might have authorization to modify the server's vCard).

6. Event Notifications

Publish-Subscribe [6] provides a way to subscribe to events, and Personal Eventing Protocol [7] defines a pubsub profile for events associated with instant messaging (IM) accounts. If PEP is supported by an IM server, it can be used to automatically generate event notifications when a user's vCard is modified.

6.1 Location

The canonical location for notifications regarding a user's vCard is a pubsub node whose name is "urn:xmpp:vcard4".

6.2 Subscribing to vCard Notifications

Let us imagine that Juliet wishes to receive the updates that Romeo publishes to his vCard. She has two options:

  1. Implicitly subscribe by advertising support for "urn:xmpp:vcard4+notify" in her Entity Capabilities [8] data. Romeo's PEP service then automatically sends vCard updates to her when it receives presence from her, until and unless she sends presence of type unavailable or stops advertising an interest in vCard updates. This is in accordance with XEP-0060, section 6.1.
  2. Explicitly subscribe by sending a formal subscription request to the "urn:xmpp:vcard4" node at Romeo's JabberID. Romeo's PEP service may send her all vCard updates even if she is offline at the time (depending on service policies regarding presence integration).

6.3 Receiving a vCard Notification

Because Juliet has sent presence to Romeo including Entity Capabilities data that includes the "urn:xmpp:vcard4+notify" feature, Romeo's XMPP server will send a PEP notification to Juliet. The notification can include an XMPP message body for backwards-compatibility with XMPP clients that are not pubsub-capable (see Message Body). This is in accordance with XEP-0060, second 6.1.7.

Example 6. Receiving a vCard publication/update

<message from='romeo@montague.lit'
         to='juliet@capulet.lit'
         type='headline'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='urn:xmpp:vcard4'>
      <item id='current'/>
    </items>
  </event>
</message>
    

Note: There is no payload, because this is a pure notification (the receiver needs to retrieve the vCard using an IQ-get as described earlier..

7. vCards of Automated Entities

Traditionally, vCards have been used on the XMPP network for entities other than human users, e.g. by XMPP servers and chatrooms. When such automated entities use vCards, it is RECOMMENDED to specify a value of "thing" for the vCard4 KIND property vCard KIND:thing [9]. An example follows.

Example 7. vCard for a Thing

<iq from='jabber.org'
    id='yhx51c35'
    to='samizzi@cisco.com/foo'
    type='result'>
  <vcard xmlns='urn:ietf:params:xml:ns:vcard-4.0'>
    <fn><text>jabber.org IM service</text></fn>
    <url><uri>http://www.jabber.org/</uri></url>
    <lang>
      <parameters><pref>1</pref></parameters>
      <language-tag>en</language-tag>
    </lang>
    <email>
      <parameters><type><text>work</text></type></parameters>
      <text>xmpp@jabber.org</text>
    </email>
    <impp>
      <parameters><type><text>work</text></type></parameters>
      <uri>xmpp:stpeter@jabber.org</uri>
    </impp>
    <logo>
      <parameters><type><text>work</text></type></parameters>
      <uri>http://www.jabber.org/wp-content/themes/carrington-blog/images/logo.png</uri>
    </logo>
    <geo>
      <parameters><type><text>work</text></type></parameters>
      <uri>geo:42.25,-91.05</uri>
    </geo>
    <tz><text>America/Chicago</text></tz>
    <kind><text>thing</text></kind>
  </vcard>
</iq>
    

8. Mapping from vcard-temp to vCard4

The following sections mention non-obvious aspects of the migration from vcard-temp to vCard4. A future version of this specification might provide a more detailed mapping.

8.1 JABBERID

The vcard-temp specification defined a <JABBERID/> element:

Example 8. Deprecated JABBERID element

<JABBERID>stpeter@jabber.org</JABBERID>
    

However, the JABBERID field was not part of the vCard3 schema. RFC 4770 [10] defined an IMPP property for instant messaging and presence addresses, which was ported to vCard4. In the vCard4 XML format, the IMPP property for a JabberID would be as follows.

Example 9. IMPP property

<impp>
  <uri>xmpp:stpeter@jabber.org</uri>
</impp>
    

8.2 DESC

The vcard-temp specification defined a <DESC/> element. This element too was not part of the vCard3 schema. There is no mapping of the vcard-temp <DESC/> element to vCard4.

9. Security Considerations

The vCard information published to one's XMPP server is world-readable; therefore, users should exercise due caution when determining what information to include (e.g., street addresses, personal telephone numbers, or email addresses).

10. IANA Considerations

This document does not require interaction with the Internet Assigned Numbers Authority (IANA) [11].

11. Open Issues

The following open issues are yet to be addressed:

  1. The mapping from XEP-0054 to vCard4 is not yet specified.
  2. It would be helpful to provide an XSLT for automated translation of vcard-temp to vCard4.

12. Acknowledgements

Thanks to Joe Hildebrand, Waqas Hussain, and Matt Miller for their feedback.


Appendices


Appendix A: Document Information

Series: XEP
Number: 0292
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.2
Last Updated: 2011-04-07
Approving Body: XMPP Council
Dependencies: XMPP Core, draft-ietf-vcarddav-vcardrev, draft-ietf-vcarddav-vcardxml
Supersedes: XEP-0054
Superseded By: None
Short Name: NOT_YET_ASSIGNED
Source Control: HTML
This document in other formats: XML  PDF


Appendix B: Author Information

Samantha Mizzi

Email: samizzi@cisco.com
JabberID: samizzi@cisco.com

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org
URI: https://stpeter.im/


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2011 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.


Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.

Errata can be sent to <editor@xmpp.org>.


Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".


Appendix G: Notes

1. XEP-0054: vcard-temp <http://xmpp.org/extensions/xep-0054.html>.

2. vCard Format Specification <http://tools.ietf.org/html/draft-ietf-vcarddav-vcardrev>. Work in progress.

3. vCard XML Representation <http://tools.ietf.org/html/draft-ietf-vcarddav-vcardxml>. Work in progress.

4. XEP-0163: Personal Eventing Protocol <http://xmpp.org/extensions/xep-0163.html>.

5. XEP-0045: Multi-User Chat <http://xmpp.org/extensions/xep-0045.html>.

6. XEP-0060: Publish-Subscribe <http://xmpp.org/extensions/xep-0060.html>.

7. XEP-0163: Personal Eventing Protocol <http://xmpp.org/extensions/xep-0163.html>.

8. XEP-0115: Entity Capabilities <http://xmpp.org/extensions/xep-0115.html>.

9. vCard KIND:thing <http://tools.ietf.org/html/draft-saintandre-vcarddav-thing>. Work in progress.

10. RFC 4770: vCard Extensions for Instant Messaging (IM) <http://tools.ietf.org/html/rfc4770>.

11. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.


Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

Version 0.2 (2011-04-07)

Updated to track base vCard4 specs; defined IQ transport, with pubsub for notifications; added examples for server vCards; specified mapping from vcard-temp.

(psa)

Version 0.1 (2011-03-02)

Initial published version.

(psa)

Version 0.0.5 (2011-02-28)

Corrected more errors in the examples.

(psa)

Version 0.0.4 (2011-02-25)

Corrected some errors in the examples.

(psa)

Version 0.0.3 (2011-02-12)

Third draft.

(psa)

Version 0.0.2 (2011-01-31)

Second draft.

(srm)

Version 0.0.1 (2010-11-30)

First draft.

(srm)

END