TBD R. Stepanek Internet-Draft FastMail Intended status: Standards Track February 28, 2019 Expires: September 1, 2019 JSContact: A JSON representation of addressbook data draft-stepanek-jscontact-00 Abstract This specification defines a data model and JSON representation of contact information that can be used for data storage and exchange in address book or directory applications. It aims to be an alternative to the vCard data format and to be unambiguous, extendable and simple to process. In contrast to the JSON-based jCard format, it is not a direct mapping from the vCard data model and expands semantics where appropriate. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on September 1, 2019. Copyright Notice Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of Stepanek Expires September 1, 2019 [Page 1] Internet-Draft JSContact February 2019 the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Relation to the xCard and jCard formats . . . . . . . . . 3 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 2. Contact . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Contact Group . . . . . . . . . . . . . . . . . . . . . . . . 7 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 5. Security Considerations . . . . . . . . . . . . . . . . . . . 7 6. Normative References . . . . . . . . . . . . . . . . . . . . 7 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 1. Introduction This document defines a data model for contact data normally used in address book or directory applications and services. It aims to be an alternative to the vCard data format [RFC6350] and to provide a JSON-based standard representation of contacts data. The key design considerations for this data model are as follows: o Most of the initial set of attributes should be taken from the vCard data format [RFC6350], but the specification should add new attributes or value types, or not support existing ones, where appropriate. Conversion between the data formats need not fully preserve semantic meaning. o The attributes of the contacts data represented must be described as a simple key-value pair, reducing complexity of its representation. o The data model should avoid all ambiguities and make it difficult to make mistakes during implementation. o Extensions, such as new properties and components, MUST NOT lead to requiring an update to this document. The representation of this data model is defined in the I-JSON format [RFC7493], which is a strict subset of the JavaScript Object Notation (JSON) Data Interchange Format [RFC8259]. Using JSON is mostly a pragmatic choice: its widespread use makes JSContact easier to adopt, and the availability of production-ready JSON implementations eliminates a whole category of parser-related interoperability issues. Stepanek Expires September 1, 2019 [Page 2] Internet-Draft JSContact February 2019 1.1. Relation to the xCard and jCard formats The xCard [RFC6351] and jCard [RFC7095] specifications define alternative representations for vCard data, in XML and JSON format respectively. Both explicitly aim to not change the underlying data model. Accordingly, they are regarded as equal to vCard in the context of this document. 1.2. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. 2. Contact MIME type: "application/jscontact+json;type=jscontact" A *JSContact* object stores contact information about a person or company. It has the following properties: o *uid*: "String" A globally unique identifier, used to associate the object as the same across different systems, addressbooks and views. The value of this property MUST be unique across _all_ JSContact objects. [RFC4122] describes a range of established algorithms to generate universally unique identifiers (UUID), and the random or pseudo-random version is recommended. For compatibility with [RFC6350] UIDs, implementations MUST accept both URI and free-form text. A valid JSContact object MUST include this property. o *prefix*: "String" (optional) The honorific title of the contact, e.g. "Mr", "Ms", "Dr", etc. o *firstName*: "String" (optional) The first name(s) of a contact. o *lastName*: "String" (optional) The last name of a contact. o *suffix*: "String" (optional) The honorific suffix of the contact, e.g. "B.A.", "Esq." etc. o *nickname*: "String" (optional) The nickname of the contact. o *birthday*: "String" (optional) The person's birth date in the form ""YYYY-MM-DD"" (any part may be all "0"s for unknown). Stepanek Expires September 1, 2019 [Page 3] Internet-Draft JSContact February 2019 o *anniversary*: "String" (optional) The person's anniversary date in the form ""YYYY-MM-DD"" (any part may be all "0"s for unknown). o *company*: "String" (optional) The company for which the person works. o *department*: "String" (optional) The department within the company for which the person works. o *jobTitle*: "String" (optional) The job title of the person. o *emails*: "ContactInformation[]" (optional) An array of ContactInformation objects where the values are email addresses. Types are: * ""personal"" The address is for emailing the person in a personal context. * ""work"" The address is for emailing the person in a professional context. * ""other"" The address is for some other purpose. A _label_ property MAY be included to display next to the address to help the user identify its purpose. o *phones*: "ContactInformation[]" (optional) An array of ContactInformation objects where the values are phone numbers. Types are: * ""home"" The number is for contacting the person at their residence. * ""work"" The number is for contacting the person at their workplace. * ""mobile"" The number is for contacting the person regardless of location. * ""fax"" The number is for sending faxes to the contact. * ""pager"" The number is for a pager or beeper associated with the contact. * ""other"" The number is for some other purpose. A _label_ property MAY be included to display next to the number to help the user identify its purpose. Stepanek Expires September 1, 2019 [Page 4] Internet-Draft JSContact February 2019 o *online*: "ContactInformation[]" (optional) An array of ContactInformation objects where the values are URIs or usernames associated with the person for online services. Types are: * ""uri"" The value is a URI, e.g. a website link. * ""username"" The value is a username associated with the person (e.g. for social media, or an IM client). A _label_ property SHOULD be included to identify what service this is for. For compatibility between clients, this label SHOULD be the canonical service name, including capitalisation. e.g. ""Twitter"", ""Facebook"", ""Skype"", ""GitHub"", ""XMPP"". * ""other"" The value is something else not covered by the above categories. A _label_ property MAY be included to display next to the number to help the user identify its purpose. o *addresses*: "Address[]" (optional) An array of Address objects, containing physical locations associated with the person. Types are: * ""home"" An address of a residence associated with the person. * ""work"" An address of a workplace associated with the person. * ""billing"" An address to be used with billing associated with the person. * ""postal"" An address to be used for delivering physical items to the person. * ""other"" An address not covered by the above categories. o *notes*: "String" (optional) Arbitrary notes about the contact. A *ContactInformation* object has the following properties: o *type*: "String" Specifies the context of the contact information. This MUST be taken from the set of values allowed depending on whether this is part of the _phones_, _emails_ or _online_ property (see above). o *label*: "String" (optional) A label describing the value in more detail, especially if "type === "other"" (but MAY be included with any type). o *value*: "String" The actual contact information, e.g. the email address or phone number. Stepanek Expires September 1, 2019 [Page 5] Internet-Draft JSContact February 2019 o *isDefault*: "Boolean" (optional, default: "false") Whether this _ContactInformation_ is the default for its type. This SHOULD only be one per type. An *Address* object has the following properties: o *type*: "String" Specifies the context of the address information. This MUST be taken from the set of values allowed (see above). o *label*: "String" (optional) A label describing the value in more detail, especially if "type === "other"" (but MAY be included with any type). o *street*: "String" (optional) The street address. This MAY be multiple lines; newlines MUST be preserved. o *locality*: "String" (optional) The city, town, village, post town, or other locality within which the street address may be found. o *region*: "String" (optional) The province, such as a state, county, or canton within which the locality may be found. o *postcode*: "String" (optional) The postal code, post code, ZIP code or other short code associated with the address by the relevant country's postal system. o *country*: "String" (optional) The country name. o *isDefault*: "Boolean" (optional, default: "false") Whether this _Address_ is the default for its type. This SHOULD only be one per type. A *File* Object has the following properties: o *href*: "String" A URI from which the resource may be fetched. This MAY be a "data:" URL, but it is recommended that the file be hosted on a server to avoid embedding arbitrarily large data in JSContact object instances. o *type*: "String" (optional) The content-type of the file, if known. o *name*: "String" (optional) The full file name, if known. e.g. "myface.png" Stepanek Expires September 1, 2019 [Page 6] Internet-Draft JSContact February 2019 o *size*: "Number" (optional) The positive integer size, in octets, of the file when fully decoded (i.e. the number of octets in the file the user would download), if known. 3. Contact Group MIME type: "application/jscontact+json;type=jscontactgroup" A *JSContactGroup* object represents a named set of contacts. It has the following properties: o *uid*: String A globally unique identifier. The same requirements as for the JSContact *uid* property apply. A valid JSContactGroup object MUST include this property. o *name*: "String" (optional) The user-visible name for the group, e.g. "Friends". This may be any UTF-8 string of at least 1 character in length and maximum 255 octets in size. The same name may be used by two different groups. o *contactIds*: "String[]" The ids of the contacts in the group. Implementations MUST preserve the order of list entries. 4. IANA Considerations TBD 5. Security Considerations TBD 6. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally Unique IDentifier (UUID) URN Namespace", RFC 4122, DOI 10.17487/RFC4122, July 2005, . [RFC6350] Perreault, S., "vCard Format Specification", RFC 6350, DOI 10.17487/RFC6350, August 2011, . Stepanek Expires September 1, 2019 [Page 7] Internet-Draft JSContact February 2019 [RFC6351] Perreault, S., "xCard: vCard XML Representation", RFC 6351, DOI 10.17487/RFC6351, August 2011, . [RFC7095] Kewisch, P., "jCard: The JSON Format for vCard", RFC 7095, DOI 10.17487/RFC7095, January 2014, . [RFC7493] Bray, T., Ed., "The I-JSON Message Format", RFC 7493, DOI 10.17487/RFC7493, March 2015, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017, . Author's Address Robert Stepanek FastMail PO Box 234, Collins St West Melbourne VIC 8007 Australia Email: rsto@fastmailteam.com Stepanek Expires September 1, 2019 [Page 8]