diff --git a/developer_manual/client_apis/OCS/index.rst b/developer_manual/client_apis/OCS/index.rst index 9a8937a9e..caef3afd7 100644 --- a/developer_manual/client_apis/OCS/index.rst +++ b/developer_manual/client_apis/OCS/index.rst @@ -1,149 +1,10 @@ .. _ocsapiindex: -======== -OCS APIs -======== +=============================== +OCS API +=============================== -This document provides a quick overview of the OCS API endpoints supported in Nextcloud. + ocs-api-overview + ocs-share-api + ocs-sharee-api -All requests need to provide authentication information, either as a Basic Auth header or by passing a set of valid session cookies, if not stated otherwise. - - -Testing requests with curl --------------------------- - -All OCS requests can be easily tested out using :code:`curl` by specifying the request method (:code:`GET`, :code:`PUT`, etc) and setting a request body where needed. - -For example: you can perform a :code:`GET` request to get information about a user: - - -.. code-block:: bash - - curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "OCS-APIRequest: true" - - -User metadata -------------- - -Since: 11.0.2, 12.0.0 - -This request returns the available metadata of a user. Admin users can see the information of all users, while a default user only can access it's own metadata. - -.. code:: - - GET /ocs/v1.php/cloud/users/USERID - - -.. code:: xml - - - - - ok - 100 - OK - - - - - true - - 338696790016 - 7438874 - 338704228890 - 0 - -3 - - user@foo.de - admin - -
- - schiessle -
-
- - -Capabilities API ----------------- - -Clients can obtain capabilities provided by the Nextcloud server and its apps via the capabilities OCS API. - -.. code:: - - GET /ocs/v1.php/cloud/capabilities - - - -.. code:: xml - - - - - ok - 100 - OK - - - - - - 12 - 0 - 0 - 12.0 beta 4 - - - - - 60 - remote.php/webdav - - - - - - -Theming capabilities --------------------- - -Values of the theming app are exposed though the capabilities API, allowing client developers to adjust the look of clients to the theming of different Nextcloud instances. - -.. code:: xml - - - Nextcloud - https://nextcloud.com - A safe home for all your data - #0082c9 - http://cloud.example.com/index.php/apps/theming/logo?v=1 - http://cloud.example.com/index.php/apps/theming/logo?v=1 - - - -The background value can either be an URL to the background image or a hex color value. - -Direct Download ---------------- - -It might be required to give a 3rd party access to a file however you do not -want to hand over credentials to the 3rd party. An example of this is playing -files in an external media player on mobile devices. - -To solve this issue there is a way to request a unique public link to a single. -This link will be valid for 24 hours after wards it will be removed. - -To obtain a direct link: - -.. code:: - - POST /ocs/v2.php/apps/dav/api/v1/direct - -With the :code:`fileId` in the body (so :code:`fileId=42` for example). -This will then return you the link to use to obtain the file. - -Notifications -------------- - -There is also the `Notifications API `_ -As well as documentation on how to `Register a device for push notifications `_ diff --git a/developer_manual/client_apis/OCS/ocs-api-overview.rst b/developer_manual/client_apis/OCS/ocs-api-overview.rst new file mode 100644 index 000000000..6d6b624ad --- /dev/null +++ b/developer_manual/client_apis/OCS/ocs-api-overview.rst @@ -0,0 +1,147 @@ +================= +OCS APIs overview +================= + +This document provides a quick overview of the OCS API endpoints supported in Nextcloud. + +All requests need to provide authentication information, either as a Basic Auth header or by passing a set of valid session cookies, if not stated otherwise. + + +Testing requests with curl +-------------------------- + +All OCS requests can be easily tested out using :code:`curl` by specifying the request method (:code:`GET`, :code:`PUT`, etc) and setting a request body where needed. + +For example: you can perform a :code:`GET` request to get information about a user: + + +.. code-block:: bash + + curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "OCS-APIRequest: true" + + +User metadata +------------- + +Since: 11.0.2, 12.0.0 + +This request returns the available metadata of a user. Admin users can see the information of all users, while a default user only can access it's own metadata. + +.. code:: + + GET /ocs/v1.php/cloud/users/USERID + + +.. code:: xml + + + + + ok + 100 + OK + + + + + true + + 338696790016 + 7438874 + 338704228890 + 0 + -3 + + user@foo.de + admin + +
+ + schiessle +
+
+ + +Capabilities API +---------------- + +Clients can obtain capabilities provided by the Nextcloud server and its apps via the capabilities OCS API. + +.. code:: + + GET /ocs/v1.php/cloud/capabilities + + + +.. code:: xml + + + + + ok + 100 + OK + + + + + + 12 + 0 + 0 + 12.0 beta 4 + + + + + 60 + remote.php/webdav + + + + + + +Theming capabilities +-------------------- + +Values of the theming app are exposed though the capabilities API, allowing client developers to adjust the look of clients to the theming of different Nextcloud instances. + +.. code:: xml + + + Nextcloud + https://nextcloud.com + A safe home for all your data + #0082c9 + http://cloud.example.com/index.php/apps/theming/logo?v=1 + http://cloud.example.com/index.php/apps/theming/logo?v=1 + + + +The background value can either be an URL to the background image or a hex color value. + +Direct Download +--------------- + +It might be required to give a 3rd party access to a file however you do not +want to hand over credentials to the 3rd party. An example of this is playing +files in an external media player on mobile devices. + +To solve this issue there is a way to request a unique public link to a single. +This link will be valid for 24 hours after wards it will be removed. + +To obtain a direct link: + +.. code:: + + POST /ocs/v2.php/apps/dav/api/v1/direct + +With the :code:`fileId` in the body (so :code:`fileId=42` for example). +This will then return you the link to use to obtain the file. + +Notifications +------------- + +There is also the `Notifications API `_ +As well as documentation on how to `Register a device for push notifications `_ diff --git a/developer_manual/core/ocs-share-api.rst b/developer_manual/client_apis/OCS/ocs-share-api.rst similarity index 100% rename from developer_manual/core/ocs-share-api.rst rename to developer_manual/client_apis/OCS/ocs-share-api.rst diff --git a/developer_manual/core/ocs-sharee-api.rst b/developer_manual/client_apis/OCS/ocs-sharee-api.rst similarity index 100% rename from developer_manual/core/ocs-sharee-api.rst rename to developer_manual/client_apis/OCS/ocs-sharee-api.rst diff --git a/developer_manual/client_apis/index.rst b/developer_manual/client_apis/index.rst index 68c18f8f0..199702897 100644 --- a/developer_manual/client_apis/index.rst +++ b/developer_manual/client_apis/index.rst @@ -11,3 +11,6 @@ Client APIs OCS/index LoginFlow/index RemoteWipe/index + ocs-share-api + ocs-sharee-api + diff --git a/developer_manual/core/index.rst b/developer_manual/core/index.rst index 307e98a2a..031da759c 100644 --- a/developer_manual/core/index.rst +++ b/developer_manual/core/index.rst @@ -12,5 +12,3 @@ Please make sure you have set up a :ref:`devenv`. translation unit-testing externalapi - ocs-share-api - ocs-sharee-api