REST interface to Nextcloud's implementation of Open Collaboration Services.
More...
|
const | SHARE_PERMISSION_ALL = 31 |
| permissions=1 gives read permission for a share.
|
|
const | SHARE_PERMISSION_READ = 1 |
| permissions=1 gives read permission for a share.
|
|
const | SHARE_TYPE_PUBLIC = 3 |
| shareType=3 creates a public share.
|
|
const | SHARE_TYPE_USER = 0 |
| shareType=0 creates a private user share.
|
|
REST interface to Nextcloud's implementation of Open Collaboration Services.
- Copyright
- 2017 Jan Dageförde (Learnweb, University of Münster)
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
repository_nextcloud\ocs_client::__construct |
( |
client |
$oauthclient | ) |
|
Get endpoint URLs from the used issuer to use them in get_api_functions().
- Parameters
-
client | $oauthclient | OAuth-authenticated Nextcloud client |
- Exceptions
-
◆ call()
repository_nextcloud\ocs_client::call |
( |
|
$functionname, |
|
|
|
$functionargs, |
|
|
|
$rawpost = false , |
|
|
|
$contenttype = false |
|
) |
| |
In POST requests, Moodle's REST API assumes that params are.
- transmitted as part of the URL or
- expressed in JSON. Neither is true; we are passing an array to $functionargs which is then put into CURLOPT_POSTFIELDS. Curl assumes the content type to be
multipart/form-data
then, but the Moodle REST API tries to put a JSON content type. As a result, clients would fail. To make this less tedious to use, we assume that the params-as-array-in-$functionargs is the default for us.
- Parameters
-
string | $functionname | Name of a function from get_api_functions() |
array | $functionargs | Request parameters |
bool | string | $rawpost | Optional param to include in the body of a post |
bool | string | $contenttype | Content type of the request body. Default: multipart/form-data if !$rawpost, JSON otherwise |
- Return values
-
- Exceptions
-
Reimplemented from core\oauth2\rest.
◆ get_api_functions()
repository_nextcloud\ocs_client::get_api_functions |
( |
| ) |
|
The documentation for this class was generated from the following file: