From 9df211b9d5ad3abfe0a72df09b54531b87a8348f Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Sat, 7 Dec 2019 16:06:48 +0100 Subject: [PATCH] add autocomplete API replacing #1566 --- .../client_apis/OCS/ocs-api-overview.rst | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/developer_manual/client_apis/OCS/ocs-api-overview.rst b/developer_manual/client_apis/OCS/ocs-api-overview.rst index 6d6b624ad..915677c4c 100644 --- a/developer_manual/client_apis/OCS/ocs-api-overview.rst +++ b/developer_manual/client_apis/OCS/ocs-api-overview.rst @@ -145,3 +145,24 @@ Notifications There is also the `Notifications API `_ As well as documentation on how to `Register a device for push notifications `_ + +Auto-complete and user search +----------------------------- + +It is possible to search for users using the auto-complete API, used to auto-complete usernames in comments, chat or to find guest accounts. The code `can be found here `_ + +An example curl command would be: + +.. code:: + + curl -i -u master -X GET -H "OCS-APIRequest: true" 'https://my.nextcloud/ocs/v2.php/core/autocomplete/get?search=JOANNE%40EMAIL.ISP&itemType=%20&itemId=%20&shareTypes[]=8&limit=2' + +That would look for JOANNE@EMAIL.ISP as guest user. Maximum 2 results to be returned + for a regular user, the shareTypes array would carry only "0" +. itemType and itemId are left (set to a white space), essentially they are to give context about the use case, so sorters can do their work (like who commented last). It can be an option for filtering on a later stage but you can also leave them out: + +.. code:: + + curl -i -u master -X GET -H "OCS-APIRequest: true" 'https://my.nextcloud/ocs/v2.php/core/autocomplete/get?search=JOANNE%40EMAIL.ISP&shareTypes[]=8&limit=2' + +The shareType would default to regular users if you left it out), the limit defaults to 10.