diff --git a/api/mapistore_http/source/index.rst b/api/mapistore_http/source/index.rst index e68d4c8..ea3070e 100644 --- a/api/mapistore_http/source/index.rst +++ b/api/mapistore_http/source/index.rst @@ -34,13 +34,21 @@ Backend info Content-Type: application/json { - "name": "My MAPISTORE Backend", - "version": 3, - "capabilities": { - "soft_delete": true, - "...": "...", - }, - }, + "name": "My MAPISTORE Backend", + "version": 3, + "capabilities": { + "soft_delete": true, + "...": "...", + }, + "contexts": [ + { + "url": "/calendars/", + "roles": ["calendar"], + "name": "Personal Calendar", + "main_folder": true + } + ] + } :reqheader Authorization: auth token :reqheader Accept: the response content type depends on @@ -402,8 +410,168 @@ Folders Email ------- -TBD +----- + +TODO + - Define sending e-mail + - Do we need special handling for Recipients? + - Move/Copy message defintion? + + +.. http:post:: /mail/ + + :synopsis: Creates a new mail message and returns its ID. + ``parent_id`` and ``PidTagSubject``` are required. + Other message attributes are optional. + + **Example request**: + + .. sourcecode:: http + + POST /mail/ HTTP/1.1 + Host: example.com + Accept: application/json + + { + "parent_id": "c7e77cc9999908ec54ae32f1faf17e0e", + "PidTagSubject": "New mail message", + "PidTagBody": "Message text body", + "PidTagBodyHtml": "...." + } + + :json string id: Message Identifier of the message created + :reqheader Authorization: auth token + :statuscode 200: Ok + :statuscode 422: The request was well-formed but was unable + to be followed due to semantic errors + + +.. http:get:: /mail/(id)/ + + :synopsis: Retrieve all the properties of an email message + identified by `id` + + **Example request**: + + .. sourcecode:: http + + GET /mail/15924213158245d0ad631c6a41a0e7c3/ HTTP/1.1 + Host: example.com + Accept: application/json + + **Example response**: + + .. sourcecode:: http + + HTTP/1.1 200 OK + Vary: Accept + Content-Type: application/json + + { + "id": "15924213158245d0ad631c6a41a0e7c3", + "parent_id": "cea793f236334942bdae2c1e6c83607d", + "PidTagSubject": "New mail message", + "PidTagBody": "Sample body", + "PidTagBodyHtml": "..." + }, + + :reqheader Authorization: auth token + :reqheader Accept: the response content depends on on + :mailheader:`Accept` header + :resheader Content-Type: this depends on :mailheader:`Accept` + header of the request + :statuscode 200: Ok + :statuscode 404: Item does not exist + + +.. http:put:: /mail/(id)/ + + :synopsis: Set properties on email message identified by `id` + + **Example request**: + + .. sourcecode:: http + + PUT /mail/15924213158245d0ad631c6a41a0e7c3/ HTTP/1.1 + Host: example.com + Accept: application/json + + { + "PidTagBody": "Sample body v2" + } + + **Example response**: + + .. sourcecode:: http + + HTTP/1.1 201 No Content + + :reqheader Authorization: auth token + :statuscode 201: The update was successfully applied + :statuscode 400: Bad request + + +.. http:head:: /mail/(id)/ + + :synopsis: Check if the email message identified by `id` exists + + **Example request**: + + .. sourcecode:: http + + HEAD /calendars/15924213158245d0ad631c6a41a0e7c3/ HTTP/1.1 + Host: example.com + + **Example response**: + + .. sourcecode:: http + + HTTP/1.1 200 OK + + :reqheader Authorization: auth token + :statuscode 200: Ok + :statuscode 404: Item does not exist + + +.. http:delete:: /mail/(id)/ + + :synopsis: Delete the email message identified by `id` + + **Example request**: + + .. sourcecode:: http + + DELETE /mail/15924213158245d0ad631c6a41a0e7c3 HTTP/1.1 + Host: example.com + + **Example response**: + + .. sourcecode:: http + + HTTP/1.1 204 No content + + :reqheader Authorization: auth token + :statuscode 204: Ok + :statuscode 404: Item does not exist + Calendar -------- @@ -423,7 +591,7 @@ Calendar { "parent_id": "cea793f236334942bdae2c1e6c83607d", "PidTagSubject": "My sample appointment", - "PidTagBody": "Sample body" + "PidTagBody": "Sample body" } **Example response**: @@ -466,9 +634,9 @@ Calendar { "id": "15924213158245d0ad631c6a41a0e7c3", - "parent_id": "cea793f236334942bdae2c1e6c83607d", - "PidTagSubject": "My sample appointment", - "PidTagBody": "Sample body" + "parent_id": "cea793f236334942bdae2c1e6c83607d", + "PidTagSubject": "My sample appointment", + "PidTagBody": "Sample body" }, :reqheader Authorization: auth token @@ -584,9 +752,9 @@ Tasks "id": "b1f2726d32b44551b99f4a6adb61e112" } - :>json string id: Message identifier of the task item created - :reqheader Authorization: auth token - :statuscode 200: Ok + :>json string id: Message identifier of the task item created + :reqheader Authorization: auth token + :statuscode 200: Ok .. http:get:: /tasks/(id)/ @@ -612,9 +780,9 @@ Tasks { "id": "b1f2726d32b44551b99f4a6adb61e112", - "parent_id": "95fc55f35da743bc9450ae694f38def0", - "PidTagSubject": "My sample task", - "PidTagBody": "Sample body" + "parent_id": "95fc55f35da743bc9450ae694f38def0", + "PidTagSubject": "My sample task", + "PidTagBody": "Sample body" }, :reqheader Authorization: auth token @@ -730,9 +898,9 @@ Contacts "id": "d220314b8a374d2bbd7f43bf0819b5a0" } - :>json string id: Message identifier of the contact item created - :reqheader Authorization: auth token - :statuscode 200: Ok + :>json string id: Message identifier of the contact item created + :reqheader Authorization: auth token + :statuscode 200: Ok .. http:get:: /contacts/(id)/ @@ -758,9 +926,9 @@ Contacts { "id": "d220314b8a374d2bbd7f43bf0819b5a0", - "parent_id": "9175fe8d54da416a9cb1a946c50b7467", - "PidTagSubject": "My sample contact", - "PidTagBody": "Sample body" + "parent_id": "9175fe8d54da416a9cb1a946c50b7467", + "PidTagSubject": "My sample contact", + "PidTagBody": "Sample body" }, :reqheader Authorization: auth token @@ -860,7 +1028,7 @@ Notes { "parent_id": "765dc8566f9e4baf94ee36e1b2763d50", "PidTagSubject": "My sample note", - "PidTagBody": "Sample body" + "PidTagBody": "Sample body" } **Example response**: @@ -875,9 +1043,9 @@ Notes "id": "f07d68499c974a5bbffed5cc3ddcc31e" } - :>json string id: Message identifier of the note item created - :reqheader Authorization: auth token - :statuscode 200: Ok + :>json string id: Message identifier of the note item created + :reqheader Authorization: auth token + :statuscode 200: Ok .. http:get:: /notes/(id)/ @@ -903,9 +1071,9 @@ Notes { "id": "f07d68499c974a5bbffed5cc3ddcc31e", - "parent_id": "765dc8566f9e4baf94ee36e1b2763d50", - "PidTagSubject": "My sample note", - "PidTagBody": "Sample body" + "parent_id": "765dc8566f9e4baf94ee36e1b2763d50", + "PidTagSubject": "My sample note", + "PidTagBody": "Sample body" }, :reqheader Authorization: auth token