List Groups

This endpoint returns a list of all custom groups.

URI Request Type

PROPFIND

remote.php/dav/customgroups/groups/

curl --silent \
  -X PROPFIND \
  --data "@list-custom-groups.xml" \
  -u username:password \
  'http://localhost/remote.php/dav/customgroups/groups/' \
  | xmllint --format -
list-custom-groups.xml
<?xml version="1.0" encoding="UTF-8"?>
<oc:customgroups 
    xmlns:a="DAV:" 
    xmlns:oc="http://owncloud.org/ns">
    <a:prop>
        <a:getlastmodified />
        <a:getcontentlength/>
        <a:quota-used-bytes/>
        <a:quota-available-bytes/>
        <a:getetag/>
        <a:getcontenttype/>
    </a:prop>
</oc:customgroups>

Successful requests return two things:

  1. An XML payload.

  2. A status of HTTP/1.1 207 Multi-Status.

You can see an example of the XML payload below. The XML payload contains a response element for each group.

<?xml version="1.0"?>
<d:multistatus 
    xmlns:d="DAV:" 
    xmlns:s="http://sabredav.org/ns" 
    xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/customgroups/groups/</d:href>
    <d:propstat>
      <d:prop>
        <d:resourcetype>
          <d:collection/>
          <oc:customgroups-groups/>
        </d:resourcetype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/customgroups/groups/testgroup/</d:href>
    <d:propstat>
      <d:prop>
        <d:resourcetype>
          <d:collection/>
          <oc:customgroups-group/>
        </d:resourcetype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <d:getlastmodified/>
        <d:getcontentlength/>
        <d:quota-used-bytes/>
        <d:quota-available-bytes/>
        <d:getetag/>
        <d:getcontenttype/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

No Results

If there are no custom groups, then a response similar to the following will be returned.

<?xml version="1.0"?>
<d:multistatus 
    xmlns:d="DAV:" 
    xmlns:s="http://sabredav.org/ns" 
    xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/customgroups/groups/</d:href>
    <d:propstat>
      <d:prop>
        <d:resourcetype>
          <d:collection/>
          <oc:customgroups-groups/>
        </d:resourcetype>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

Rename Custom Group

This endpoint allows a custom group to be renamed.

Only group admins can rename the groups that they manage.
URI Request Type

PROPPATCH

remote.php/dav/customgroups/groups/<$groupId>

curl --silent \
  -X PROPPATCH \
  --data "@rename-custom-group.xml" \
  -u username:password \
  'http://localhost/remote.php/dav/customgroups/groups/&lt;$groupId&gt;' \
  | xmllint --format -
rename-custom-group.xml
<?xml version="1.0" encoding="UTF-8"?>
<a:propertyupdate 
    xmlns:a="DAV:" 
    xmlns:oc="http://owncloud.org/ns">
    <a:prop>
        <oc:display-name>test_group</oc:display-name>
    </a:prop>
</a:propertyupdate>

Responses

Success

A successful request will only return a status of HTTP/1.1 204 No Content. No other information will be returned or displayed.

Failure
Insufficient Privileges or the User is not Authorized

If the user making the request that only and admin can perform, then a status of HTTP/1.1 401 Unauthorized will be returned.

If the user making the request has insufficient privileges to make the request then a status of HTTP/1.1 401 Unauthorized will be returned, along with the following XML in the response’s body:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
  <s:message>No public access to this resource., Username or password was incorrect, Username or password was incorrect</s:message>
</d:error>
Missing Group

If the specified group does not exist, then the following XML response body will be returned, along with an HTTP/1.1 207 Multi-Status status.

<?xml version="1.0" encoding="utf-8"?>
<d:error 
    xmlns:d="DAV:" 
    xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotFound</s:exception>
  <s:message>Group with uri "testgroup" not found</s:message>
</d:error>

Delete Group

This endpoint allows for a custom group to be deleted.

Only group admins can delete a group.
URI Request Type

DELETE

remote.php/dav/customgroups/groups/<$groupId>

curl --silent \
  -X DELETE \
  --data "@" \
  -u username:password \
  'http://localhost/remote.php/dav/customgroups/groups/&lt;$groupId&gt;' \
  | xmllint --format -

Responses

Success

A successful request will only return a status of HTTP/1.1 204 No Content. No other information will be returned or displayed.

Failure
Insufficient Privileges or the User is not Authorized

If the user making the request that only and admin can perform, then a status of HTTP/1.1 401 Unauthorized will be returned.

If the user making the request has insufficient privileges to make the request then a status of HTTP/1.1 401 Unauthorized will be returned, along with the following XML in the response’s body:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
  <s:message>No public access to this resource., Username or password was incorrect, Username or password was incorrect</s:message>
</d:error>

Create Group

This endpoint allows for creating a custom group.

The group’s creator automatically becomes the group’s admin and its initial member.
URI Request Type

MKCOL

remote.php/dav/customgroups/groups/<$groupId>

curl --silent \
  -X MKCOL \
  --data "@" \
  -u username:password \
  'http://localhost/remote.php/dav/customgroups/groups/&lt;$groupId&gt;' \
  | xmllint --format -

Responses

Success

A successful request will only return a status of HTTP/1.1 201 Created. No other information will be returned or displayed.

Failure
Insufficient Privileges or the User is not Authorized

If the user making the request that only and admin can perform, then a status of HTTP/1.1 401 Unauthorized will be returned.

If the user making the request has insufficient privileges to make the request then a status of HTTP/1.1 401 Unauthorized will be returned, along with the following XML in the response’s body:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
  <s:message>No public access to this resource., Username or password was incorrect, Username or password was incorrect</s:message>
</d:error>