<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-baum-jmap-rest-00" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="true" consensus="true">

<front>
<title abbrev="JMAP REST">JMAP REST Mapping</title><seriesInfo value="draft-baum-jmap-rest-00" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author role="editor" initials="J.M." surname="Baum" fullname="Joris Baum"><organization>audriga</organization><address><postal><street>Alter Schlachthof 57</street>
<city>Karlsruhe </city>
<code>76137</code>
<country>Germany</country>
</postal><email>joris@audriga.com</email>
<uri>https://www.audriga.com</uri>
</address></author><author role="editor" initials="H.J." surname="Happel" fullname="Hans-Joerg"><organization>audriga</organization><address><postal><street>Alter Schlachthof 57</street>
<city>Karlsruhe </city>
<code>76137</code>
<country>Germany</country>
</postal><email>hans-joerg@audriga.com</email>
<uri>https://www.audriga.com</uri>
</address></author><date year="2023" month="April" day="6"></date>
<area>Applications</area>
<workgroup>JMAP</workgroup>
<keyword>jmap</keyword>
<keyword>rest</keyword>

<abstract>
<t>This document specifies a REST Mapping for JMAP endpoints to impose fewer requirements on applications compared to conventional JMAP endpoints.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Structured data exchange over JMAP <xref target="RFC8620"></xref> usually involves processing JMAP Request JSON payloads. This might impose unnecessary requirements for certain use cases of JMAP. Likely scenarios in which this is beneficiary are situations in which portability needs to be provided due to regulatory requirements or when migrating user data away from legacy platforms.</t>
<t>For rapid development of a JMAP API without
support for batching, the essential properties of the Request object can instead
be implemented as a URI.</t>

<section anchor="conventions-used-in-this-document"><name>Conventions Used In This Document</name>
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL
NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;NOT RECOMMENDED&quot;,
&quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref> when, and only when,
they appear in all capitals, as shown here.</t>
<t>The definitions of JSON keys and datatypes in the document follow
the conventions described in the core JMAP specification <xref target="RFC8620"></xref>.</t>
</section>

<section anchor="addition-to-the-capabilities-object"><name>Addition to the capabilities object</name>
<t>The capabilities object is returned as part of the JMAP Session object;
see <xref target="RFC8620"></xref>, Section 2. This document defines one additional capability URI.</t>

<section anchor="urn-ietf-params-jmap-rest"><name>urn:ietf:params:jmap:rest</name>
<t>The capability <tt>urn:ietf:params:jmap:rest</tt> being present in the &quot;capabilities&quot; property represents support for the simplified JMAP REST API.</t>
<t>The value of this property in the JMAP Session capabilities property and the
account's accountCapabilities property is an empty object.</t>
</section>
</section>

<section anchor="addition-to-the-session-resource"><name>Addition to the Session Resource</name>
<t>The JMAP Session Resource will be extended by the following property:</t>

<ul spacing="compact">
<li><strong>apiUrlSimple</strong>: <tt>String</tt> The URL to use for JMAP API requests. THE URL MUST
contain the variables <tt>using</tt> and <tt>methodCall</tt> as defined in <xref target="RFC8620"></xref> Section 3.3. One MAY use additional variables specific to a JMAP method like <tt>ids</tt> or <tt>accountId</tt>. Implementations MAY implement the required variables as query parameters to avoid implementing routing logic.</li>
</ul>

<section anchor="capability-example"><name>Capability Example</name>

<sourcecode type="json">{
  ...
  &quot;capabilities&quot;: {
    ...,
    &quot;urn:ietf:params:jmap:rest&quot;: {}
  },
  &quot;apiUrlRest&quot;: &quot;https://jmap.me/api
    /?accountId=&lt;account-id&gt;&amp;methodCall=&lt;methodCall&gt;&amp;ids=&lt;ids&gt;&quot;
}
</sourcecode>
</section>
</section>
</section>

<section anchor="security"><name>Security considerations</name>
<t>All security considerations of JMAP <xref target="RFC8620"></xref> apply to this specification.</t>
</section>

<section anchor="iana-considerations"><name>IANA considerations</name>

<section anchor="jmap-capability-registration-for-rest"><name>JMAP Capability registration for &quot;rest&quot;</name>
<t>IANA is requested to register the &quot;rest&quot; JMAP Capability as follows:</t>
<t>Capability Name: urn:ietf:params:jmap:rest</t>
<t>Specification document: this document</t>
<t>Intended use: common</t>
<t>Change Controller: IETF</t>
<t>Security and privacy considerations: this document, <xref target="security"></xref>.</t>
</section>
</section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>Bron Gondwana, Neil Jenkins, Alexey Melnikov, Ken Murchison, Robert Stepanek and
the JMAP working group at the IETF.</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8620.xml"/>
</references>

</back>

</rfc>
