Roles API

Table of Contents

Introduction

The roles API allows clients to ask the server for supported roles. Three things are worth noting about this API:

  1. Only roles for public links are implemented.

  2. Apps can listen to the event dispatcher and add their own roles.

  3. Apps cannot change existing roles.

Get Roles

Request Path Method Content Type

ocs/v1.php/cloud/roles

GET

text/xml or text/json

Request Parameters

Attribute Type Description

format

string

The format of the response content. Accepted values are xml and json.

Code Example

Returns

On success, the request returns either an XML (the default) or a JSON response body, along with an HTTP 200 OK status code. The response body lists all the available roles, along with information about each one.

Example Responses

Setting The Language of the Response Body

The language of the response’s content can be set with the Accept-Language header. By default, the response will be in English. You can see an example of requesting the response in a specific language in the code example below.