This specification proposes a simple mechanism by which applications can transfer data safely, without
needing additional protocol design work. It is intended to provide a protocol that is trivial to implement and can
be driven with a simple API.
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.
Applications written on top of XMPP often need to exchange data that has no existing standard. Such applications are
often written by developers unfamiliar with best practise in designing new extensions for XMPP, making it hard to achieve
this simple design goal without causing longer term problems.
This leads to "solutions" such as stuffing JSON directly in the <body/> element, for example, and recognising
this at the receiver either by heuristics or by a special <subject/>. While this works, it is difficult to then
migrate to something else, and enforces that custom clients are always used.
Therefore this document proposes a very simple (and simplistic) framework for sending such data which - while
very light on features - nevertheless conforms to best practice, and yields an interoperable protocol. Unusually, this
specification SHOULD NOT be used as a base upon which to build other standards.
Simple JSON Messaging payloads may also be placed within a <message/> stanza. <message/> stanzas MAY contain multiple UDT
payloads, but typical usage is expected to be that there will be only one. The JSON Messaging payload may be ancillary data
to another message, or a standalone message in its own right.
A Simple JSON Messaging payload consists of a single element, <payload/>, qualified by the XML namespace
urn:xmpp:json-msg:0. It has a single, mandatory attribute of datatype, which MUST contain a string conformant
to the requirements for XML namespaces (typically a URI under the control of the application developer).
As with XML namespaces, this URI is never expected to be resolved, and is used solely as an identifier.
Different strings are considered entirely different datatypes, and common prefixes etc MUST be considered
irrelevant for the purposes of interpreting the data. There are no common or standard datatypes.
The <payload element contains exactly one mandatory child element, the <json/> element
defined in JSON Containers (XEP-0335) . This in turns contains the JSON data.
In order to satisfy the goals of this protocol, client library developers are encouraged to provide a simple to use API for this protocol. Developers are encouraged to use terms such as "JSON Message" in their API calls and documentation.
Support for a particular datatype SHOULD be advertised automatically when listening for custom messages of that type if possible.
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.
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 <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) 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.
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".
3. 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/>.