From a1863c6d49dc97484915bcda25fbe318ee92a213 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 20 Sep 2021 08:34:41 +0200 Subject: [PATCH] Update README.md --- doc/REST-CalDAV-CardDAV/README.md | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/doc/REST-CalDAV-CardDAV/README.md b/doc/REST-CalDAV-CardDAV/README.md index 74b6e27cf4..228f5f8061 100644 --- a/doc/REST-CalDAV-CardDAV/README.md +++ b/doc/REST-CalDAV-CardDAV/README.md @@ -41,14 +41,14 @@ from the data of a allprop PROPFIND, allow browsing CalDAV/CardDAV tree with a r > currently implemented only for contacts! Following RFCs / drafts used/planned for JSON encoding of ressources -* [draft-ietf-jmap-jscontact: JSContact: A JSON representation of contact data](https://datatracker.ietf.org/doc/html/draft-ietf-jmap-jscontact-07) +* [draft-ietf-jmap-jscontact: JSContact: A JSON Representation of Contact Data](https://datatracker.ietf.org/doc/html/draft-ietf-jmap-jscontact-07) * [rfc8984: JSCalendar: A JSON Representation of Calendar Data](https://datatracker.ietf.org/doc/html/rfc8984) ### Supported request methods and examples * **GET** to collections with an ```Accept: application/json``` header return all resources (similar to WebDAV PROPFIND)
- Getting all entries of a given users addessbook + Example: Getting all entries of a given users addessbook ``` curl https://example.org/egroupware/groupdav.php//addressbook/ -H "Accept: application/pretty+json" --user @@ -112,7 +112,7 @@ curl https://example.org/egroupware/groupdav.php//addressbook/ -H "Acc this will return a "more-results"=true attribute and a new "sync-token" attribute to query for the next chunk
- Getting just ETAGs and displayname of all contacts in a given AB + Example: Getting just ETAGs and displayname of all contacts in a given AB ``` curl -i 'https://example.org/egroupware/groupdav.php//addressbook/?props[]=getetag&props[]=displayname' -H "Accept: application/pretty+json" --user @@ -132,7 +132,7 @@ curl -i 'https://example.org/egroupware/groupdav.php//addressbook/?pro
- Start using a sync-token to get only changed entries since last sync + Example: Start using a sync-token to get only changed entries since last sync #### Initial request with empty sync-token and only requesting 10 entries per chunk: ``` @@ -177,9 +177,9 @@ curl 'https://example.org/egroupware/groupdav.php/addressbook/?sync-token=https:
- Requesting only changes since last sync + Example: Requesting only changes since last sync -#### ```sync-token``` from last sync need to be specified (note the null for deleted entries!) +#### ```sync-token``` from last sync need to be specified (note the null for a deleted resource!) ``` curl 'https://example.org/egroupware/groupdav.php/addressbook/?sync-token=https://example.org/egroupware/groupdav.php/addressbook/1400867824' -H "Accept: application/pretty+json" --user { @@ -203,9 +203,9 @@ curl 'https://example.org/egroupware/groupdav.php/addressbook/?sync-token=https: ```
-* **GET** requests with an "Accept: application/json" header can be used to retrieve single resources / JsContact or JsCalendar schema +* **GET** requests with an ```Accept: application/json``` header can be used to retrieve single resources / JsContact or JsCalendar schema
- Example GET request + Example: GET request for a single resource ``` curl 'https://example.org/egroupware/groupdav.php/addressbook/5593' -H "Accept: application/pretty+json" --user @@ -227,7 +227,7 @@ curl 'https://example.org/egroupware/groupdav.php/addressbook/5593' -H "Accept: * **POST** requests to collection with a "Content-Type: application/json" header add new entries in addressbook or calendar collections (Location header in response gives URL of new resource)
- Example POST request + Example: POST request to create a new resource ``` cat </addressbook/' -X POST -d @- -H "Content-Type: application/json" --user @@ -250,11 +250,8 @@ Location: https://example.org/egroupware/groupdav.php//addressbook/123 ```
-* **PUT** requests with a "Content-Type: application/json" header allow modifying single resources +* **PUT** requests with a ```Content-Type: application/json``` header allow modifying single resources * **DELETE** requests delete single resources * one can use ```Accept: application/pretty+json``` to receive pretty-printed JSON eg. for debugging and exploring the API - -Permanent error_log() calls should use groupdav->log($str) instead, to be send to PHP error_log() -and our request-log (prefixed with "### " after request and response, like exceptions).