Internet-Draft | JSContact | April 2022 |
Stepanek & Loffredo | Expires 13 October 2022 | [Page] |
This specification defines a data model and JSON representation of contact card 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.¶
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 13 October 2022.¶
Copyright (c) 2022 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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
This document defines a data model for contact card 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 contact card data.¶
The key design considerations for this data model are as follows:¶
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 Card easier to adopt, and the availability of production-ready JSON implementations eliminates a whole category of parser-related interoperability issues.¶
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.¶
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.¶
Vendors MAY add additional properties to the contact object to support their custom features. To avoid conflict, the names of these properties MUST be prefixed by a domain name controlled by the vendor followed by a colon, e.g., "example.com:customprop". If the value is a new JSContact object, it either MUST include an "@type" property, or it MUST explicitly be specified to not require a type designator. The type name MUST be prefixed with a domain name controlled by the vendor.¶
Some JSContact properties allow vendor-specific value extensions. Such vendor-specific values MUST be prefixed by a domain name controlled by the vendor followed by a colon, e.g., "example.com:customrel".¶
Vendors are strongly encouraged to register any new property values or extensions that are useful to other systems as well, rather than use a vendor-specific prefix.¶
Type signatures are given for all JSON values in this document. The following conventions are used:¶
*
- The type is undefined (the value could be any type, although permitted values may be constrained by the context of this value).¶
String
- The JSON string type.¶
Number
- The JSON number type.¶
Boolean
- The JSON boolean type.¶
A[B]
- A JSON object where the keys are all of type A
, and the values are all of type B
.¶
A[]
- An array of values of type A
.¶
A|B
- The value is either of type A
or of type B
.¶
In addition to the standard JSON data types, a couple of additional data types are common to the definitions of JSContact objects and properties.¶
Contact information typically is associated with a context in which it should be used. For example, someone might have distinct phone numbers for work and private contexts. The Context data type enumerates common contexts.¶
Common context values are:¶
private
: The contact information may be used to contact the card holder in a private context.¶
work
: The contact information may be used to contact the card holder in a professional context.¶
Additional allowed values may be defined in the properties or data types that make use of the Context data type, registered in a future RFC, or a vendor-specific value.¶
Where Id
is given as a data type, it means a String
of at least 1 and a maximum of 255 octets in size, and it MUST only contain characters from the URL and Filename Safe
base64url alphabet, as defined in Section 5 of [RFC4648], excluding the pad character (=
). This means the allowed characters are the ASCII alphanumeric characters (A-Za-z0-9
), hyphen (-
), and underscore (_
).¶
In many places in JSContact a JSON map is used where the map keys are of type Id and the map values are all the same type of object. This construction represents an unordered set of objects, with the added advantage that each entry has a name (the corresponding map key). This allows for more concise patching of objects, and, when applicable, for the objects in question to be referenced from other objects within the JSContact object.¶
Unless otherwise specified for a particular property, there are no uniqueness constraints on an Id value (other than, of course, the requirement that you cannot have two values with the same key within a single JSON map). For example, two Card objects might use the same Ids in their respective photos
properties. Or within the same Card object the same Id could appear in the emails
and phones
properties. These situations do not imply any semantic connections among the objects.¶
A PatchObject is of type String[*]
, and represents an unordered set of patches on a JSON object.
Each key is a path represented in a subset of JSON pointer format [RFC6901]. The paths have an implicit leading /
, so each key is prefixed with /
before applying the JSON pointer evaluation algorithm.¶
A patch within a PatchObject is only valid if all of the following conditions apply:¶
addresses/1/city
and addresses
.¶
The value associated with each pointer determines how to apply that patch:¶
A PatchObject does not define its own @type
property. Instead, a @type
property in a patch MUST be handled as any other patched property value.¶
Implementations MUST reject in its entirety a PatchObject if any of its patches is invalid. Implementations MUST NOT apply partial patches.¶
This data type allows to define a preference order on same-typed contact information. For example, a card holder may have two email addresses and prefer to be contacted with one of them.¶
A preference value MUST be an integer number in the range 1 and 100. Lower values correspond to a higher level of preference, with 1 being most preferred. If no preference is set, then the contact information MUST be interpreted as being least preferred.¶
Note that the preference only is defined in relation to contact information of the same type. For example, the preference orders within emails and phone numbers are indendepent of each other. Also note that the preferredContactMethod property allows to define a preferred contact method across method types.¶
Where UnsignedInt
is given as a data type, it means an integer in the range 0 <= value <= 253-1, represented as a JSON Number
.¶
This is a string in [RFC3339] date-time
format, with the further restrictions that any letters MUST be in uppercase, and the time offset MUST be the character Z
. Fractional second values MUST NOT be included unless non-zero and MUST NOT have trailing zeros, to ensure there is only a single representation for each date-time.¶
For example, 2010-10-10T10:10:10.003Z
is conformant, but 2010-10-10T10:10:10.000Z
is invalid and is correctly encoded as 2010-10-10T10:10:10Z
.¶
MIME type: application/jscontact+json;type=card
¶
A Card object stores information about a person, organization or company.¶
Type: String
(mandatory).¶
An identifier, used to associate the object as the same across different systems, addressbooks and views. [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.¶
Type: String
(optional).¶
The identifier for the product that created the Card object.¶
Type: UTCDateTime
(optional).¶
The date and time when the data in this Card object was last modified.¶
Type: Name
(optional).¶
The name of the entity represented by this Card.¶
A Name object has the following properties¶
Name
(mandatory).
Specifies the type of this object. This MUST be Name
.¶
NameComponent[]
(mandatory).
The components making up the name. The component list MUST have at least one entry. Name components SHOULD be ordered such that their values joined by whitespace produce a valid full name of this entity. Doing so, implementations MAY ignore any components of type separator
.¶
String
(optional).
The locale of the name. The value MUST be a language tag as defined [RFC5646].¶
A NameComponent object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be NameComponent
.¶
String
(mandatory).
The value of this name component.¶
type: String
(mandatory).
The type of this name component. The value MUST be either one of the following values, registered in a future RFC, or a vendor-specific value:¶
prefix
. The value is a honorific title(s), e.g. "Mr", "Ms", "Dr".¶
given
. The value is a given name, also known as "first name", "personal name".¶
surname
. The value is a surname, also known as "last name", "family name".¶
middle
. The value is a middle name, also known as "additional name".¶
suffix
. The value is a honorific suffix, e.g. "B.A.", "Esq.".¶
separator
. A formatting separator for two name components. The value
property of the component includes the verbatim separator, for example a newline character.¶
nth: UnsignedInt
(optional, default: 1
).
Defines the rank of this name component to other name components of the same type. If set, the property value MUST be higher than or equal to 1.¶
For example, two name components of type surname
may have their nth
property value set to 1
and 2
, respectively. In this case, the first name component defines the surname, and the second name component the secondary surname.¶
Note that this property value does not indicate the order in which to print name components of the same type. Some cultures print the secondary surname before the first surname, others the first before the second. Implementations SHOULD inspect the locale
property of the Name object to determine the appropriate formatting. They MAY print name components in order of appearance in the components
property of the Name object.¶
Type: String
(optional).¶
The full name (e.g. the personal name and surname of an individual, the name of an organization) of the entity represented by this card. The purpose of this property is to define a name, even if the individual name components are not known. In addition, it is meant to provide alternative versions of the name for internationalisation. Implementations SHOULD prefer using the name property over this one and SHOULD NOT store the concatenated name component values in this property.¶
Type: String[]
(optional).¶
The nick names of the entity represented by this card.¶
Type: Id[Organization]
(optional).¶
The companies or organization names and units associated with this card. An Organization object has the following properties:¶
Type : Id[Title]
(optional).¶
The job titles or functional positions of the entity represented by this card. A Title has object the following properties:¶
Type: SpeakToAs
(optional).¶
Provides information how to address, speak to or refer to the entity that is represented by this card. A SpeakToAs object has the following properties, of which at least one property other than @type
MUST be set:¶
String
(mandatory).
Specifies the type of this object. This MUST be SpeakToAs
.¶
grammaticalGender: String
(optional).
Defines which grammatical gender to use in salutations and other grammatical constructs. Allowed values are:¶
Note that the grammatical gender does not allow to infer the gender identities or biological sex of the contact.¶
pronouns: String
(optional).
Defines the gender pronouns that the contact chooses to use for themselves. Any value or form is allowed. Examples in English include she/her
and they/them/theirs
.¶
The property values SHOULD be localized in the language defined in the language
property. They MAY be overridden in the localizations
property (Section 2.5.1).¶
Type: Id[EmailAddress]
(optional).¶
The email addresses to contact the entity represented by this card. An EmailAddress object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be EmailAddress
.¶
String
(mandatory).
The email address. This MUST be an addr-spec value as defined in Section 3.4.1 of [RFC5322].¶
Context[Boolean]
(optional)
The contexts in which to use this email address. The value for each key in the object MUST be true
.¶
Preference
(optional)
The preference of this email address in relation to other email addresses.¶
String
(optional).
A label describing the value in more detail.¶
Type: Id[Phone]
(optional).¶
The phone numbers to contact the entity represented by this card. A Phone object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be Phone
.¶
String
(mandatory).
The phone value, as either a URI or a free-text phone number. Typical URI schemes are the [RFC3966] tel
or [RFC3261] sip
schemes, but any URI scheme is allowed.¶
features: String[Boolean]
(optional).
The set of contact features that this phone number may be used for. The set is represented as an object, with each key being a method type. The value for each key in the object MUST be true
. The method type MUST be either one of the following values, registered in a future RFC, or a vendor-specific value:¶
voice
The number is for calling by voice.¶
fax
The number is for sending faxes.¶
pager
The number is for a pager or beeper.¶
text
The number supports text messages (SMS).¶
cell
The number is for a cell phone.¶
textphone
The number is for a device for people with hearing or speech difficulties.¶
video
The number supports video conferencing.¶
Context[Boolean]
(optional)
The contexts in which to use this number. The value for each key in the object MUST be true
.¶
Preference
(optional)
The preference of this number in relation to other numbers.¶
String
(optional).
A label describing the value in more detail.¶
Type: Id[Resource]
(optional).¶
The online resources and services that are associated with the entity represented by this card. A Resource object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be Resource
.¶
String
(mandatory).
The resource value, where the allowed value form is defined by the the type property. If the value form is URI, then the property value MUST be a valid URI as defined in Section 3 of [RFC3986] and updates. In any case the value MUST NOT be empty.¶
type: String
(optional).
The type of the resource. Allowed values are:¶
audio
The resource is a digital sound URI, such as a recording of proper pronunciation of the name of this card.¶
calendar
The resource is a calendar URI associated with the entity represented by this card.¶
contact
The resource is an alternative contact method URI to contact the entity represented by this card. This typically is a web contact form using the "https" URI scheme, but may be any other.¶
directory
The resource is a directory service URI where the entity represented by this card can be found in. This typically is an organizational directory that also contains associated entities, e.g. co-workers and management in a company directory.¶
directorySource
The resource is a directory service entry URI of the entity represented by this card. In contrast to the "directory" type this resource only provides the means to access directory information for this entity.¶
freeBusy
The resource is a free-busy calendaring URI for the entity represented by this card.¶
logo
The resource is a graphic logo URI associated with the entity represented by this card.¶
publicKey
The resorce is a cryptograhic public key or certificate URI associated with the entity represented by this card.¶
uri
The resource value is any URI, e.g. a website link.¶
username
The resource value is a username associated with the entity represented by this card (e.g. for social media, or an IM client). The 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
. The resource value may be any non-empty free text.¶
String
(optional).
Used for URI resource values. Provides the media type [RFC2046] of the resource identified by the URI.¶
Context[Boolean]
(optional)
The contexts in which to use this resource. The value for each key in the object MUST be true
.¶
Preference
(optional)
The preference of this resource in relation to other resources.¶
String
(optional).
A label describing the value in more detail.¶
Type: Id[Scheduling]
(optional).¶
The methods by which the entity receives calendar scheduling invitations and updates. A Scheduling object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be Scheduling
.¶
String[String]
(mandatory).
The keys in the property value are the available methods for scheduling. The value is a URI for the method specified in the key. This MUST be a valid "sendTo" property value as specified in Section 4.4.6 of [RFC8984] and updates.¶
Preference
(optional)
The preference of this scheduling object in relation to other scheduling objects.¶
Type: Id[File]
(optional).¶
A map of photo ids to File objects that contain photographs or images associated with this card. A typical use case is to include an avatar for display along the contact name.¶
A File object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be File
.¶
String
(mandatory). A URI where to fetch the data of this file.¶
String
(optional). The content-type of the file, if known.¶
UnsignedInt
(optional). The size, in octets, of the file when fully decoded (i.e., the number of octets in the file the user would download), if known.¶
Preference
(optional)
The preference of this photo in relation to other photos.¶
String
(optional).
A label describing the value in more detail.¶
Type : String
(optional)¶
Defines the preferred method to contact the holder of this card. The value MUST be the property names: emails
, phones
, online
.¶
Type : String[ContactLanguage[]]
(optional)¶
Defines the preferred languages for contacting the entity associated with this card. The keys in the object MUST be [RFC5646] language tags. The values are a (possibly empty) list of contact language preferences for this language. A valid ContactLanguage object MUST have at least one of its properties set.¶
A ContactLanguage object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be ContactLanguage
.¶
Context
(optional).
Defines the context in which to use this language.¶
Preference
(optional).
Defines the preference of this language in relation to other languages of the same context.¶
Also see the definition of the VCARD LANG property (Section 6.4.4., [RFC6350]).¶
Type: Id[Address]
(optional).¶
A map of address ids to Address objects, containing physical locations. An Address object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be Address
.¶
String
(optional).
The complete address, excluding type and label. This property is mainly useful to represent addresses of which the individual address components are unknown, or to provide localized representations.¶
street: StreetComponent[]
(optional).
The street address. The concatenation of the component values, separated by whitespace, SHOULD result in a valid street address for the address locale. Doing so, implementations MAY ignore any separator
components. The StreetComponent object type is defined in the paragraph below.¶
String
(optional).
The city, town, village, post town, or other locality within which the street address may be found.¶
String
(optional).
The province, such as a state, county, or canton within which the locality may be found.¶
String
(optional).
The country name.¶
String
(optional).
The postal code, post code, ZIP code or other short code associated with the address by the relevant country's postal system.¶
String
(optional).
The ISO-3166-1 country code.¶
String
(optional) A [RFC5870] "geo:" URI for the address.¶
String
(optional) Identifies the time zone this address is located in. This either MUST be a time zone name registered in the IANA Time Zone Database, or it MUST be a valid TimeZoneId as defined in [RFC8984]. For the latter, a corresponding time zone MUST be defined in the timeZones
property.¶
contexts: Context[Boolean]
(optional).
The contexts of the address information. In addition to the common contexts, allowed values are:¶
Preference
(optional)
The preference of this address in relation to other addresses.¶
String
(optional).
A label describing the value in more detail.¶
A StreetComponent object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be StreetComponent
.¶
type: String
(mandatory).
The type of this street component. The value MUST be either one of the following values, registered in a future RFC, or a vendor-specific value:¶
name
. The street name.¶
number
. The street number.¶
apartment
. The apartment number or identifier.¶
room
. The room number or identifier.¶
extension
. The extension designation or box number.¶
direction
. The cardinal direction, e.g. "North".¶
building
. The building or building part this address is located in.¶
floor
. The floor this address is located on.¶
postOfficeBox
. The post office box number or identifier.¶
separator
. A separator for two street components. The value
property of the component includes the verbatim separator, for example a newline character.¶
unknown
. A name component value for which no type is known.¶
String
(mandatory).
The value of this street component.¶
Type: String[PatchObject] (optional).¶
A map of language tags [RFC5646] to patches, which localize a property value into the locale of the respective language tag. The paths in the PatchObject keys are relative to the Card object that includes the localizations property. A patch MUST NOT target the localizations
property.¶
The following example shows a Card object, where one of its addresses Tokyo
is localized for the jp
locale.¶
"@type": "Card", ... "addresses": { "addr1": { "@type": "Address", "locality": "Tokyo", } }, "localizations": { "jp": { "addresses/addr1/locality":"東京" } }
Type : Id[Anniversary] (optional).¶
These are memorable dates and events for the entity represented by this card. An Anniversary object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be Anniversary
.¶
type: String
(optional).
Specifies the type of the anniversary. This RFC predefines the following types, but implementations MAY use additional values:¶
String
(mandatory).
The date of this anniversary, in the form "YYYY-MM-DD" (any part may be all 0s for unknown) or a [RFC3339] timestamp.¶
String
(optional).
A label describing the value in more detail.¶
Type: Id[PersonalInformation]
(optional).¶
Defines personal information about the entity represented by this card. A PersonalInformation object has the following properties:¶
String
(mandatory).
Specifies the type of this object. This MUST be PersonalInformation
.¶
type: String
(mandatory).
Specifies the type for this personal information. Allowed values are:¶
String
(mandatory).
The actual information. This generally is free-text, but future specifications MAY restrict allowed values depending on the type of this PersonalInformation.¶
String
(optional)
Indicates the level of expertise, or engagement in hobby or interest. Allowed values are: high
, medium
and low
.¶
String
(optional).
A label describing the value in more detail.¶
Type: String[Boolean]
(optional).
The set of free-text or URI categories that relate to the card. The set is represented as an object, with each key being a category. The value for each key in the object MUST be true
.¶
MIME type: application/jscontact+json;type=cardgroup
¶
A CardGroup object represents a group of cards. Its members may be Cards or CardGroups.¶
Type: String
(mandatory). The uid of this group. Both CardGroup and Card share the same namespace for the uid
property.¶
Type: String[Boolean]
(mandatory). The members of this group.¶
The set is represented as an object, with each key being the uid of another Card or CardGroup. The value for each key in the object MUST be true
.¶
NOTE: Please remove this section and the reference to [RFC7942] prior to publication as an RFC. This section records the status of known implementations of the protocol defined by this specification at the time of posting of this Internet-Draft, and is based on a proposal described in [RFC7942]. The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs. Please note that the listing of any individual implementation here does not imply endorsement by the IETF. Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors. This is not intended as, and must not be construed to be, a catalog of available implementations or their features. Readers are advised to note that other implementations may exist. According to [RFC7942], "this will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature. It is up to the individual working groups to use this information as they see fit".¶