Group Membership

List Members

This endpoint allows for listing all of the members in a custom group.

Only group members can list a group’s members. Other users will receive a status of HTTP/1.1 403 Forbidden
URI Request Type

PROPFIND

/remote.php/dav/customgroups/users/

curl --silent \
  -X PROPFIND \
  --data "@list-custom-group-members.xml" \
  -u username:password \
  'http://localhost//remote.php/dav/customgroups/users/' \
  | xmllint --format -
list-custom-group-members.xml
<?xml version="1.0" encoding="UTF-8"?>
<a:propfind
    xmlns:a="DAV:" 
    xmlns:oc="http://owncloud.org/ns">
    <a:prop>
        <oc:role/>
    </a:prop>
</a:propfind>

Responses

Success

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.

<?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/testgroup2/</d:href>
    <d:propstat>
      <d:prop>
        <oc:role/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/customgroups/groups/testgroup2/admin</d:href>
    <d:propstat>
      <d:prop>
        <oc:role>admin</oc:role>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>
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>

Add Member

This endpoint allows for adding members to a custom group.

Only group admins can add members.
URI Request Type

PUT

/remote.php/dav/customgroups/users/<$numericGroupId>/<$userId>

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

Responses

Success

If the request succeeds, then only a HTTP/1.1 201 Created status will be returned.

Failure
Method Not Allowed

If the request was made using any other method than PUT, then an HTTP/1.1 405 Method Not Allowed status will be returned, along with the XML payload below:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\MethodNotAllowed</s:exception>
  <s:message>Cannot create collections</s:message>
</d:error>
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>

Remove Member

This endpoint allows for removing members from a custom group.

Only group admins can remove members. Group admins cannot remove themselves if no other admin exists in the group. A group member can remove themselves using this API call.
URI Request Type

DELETE

/remote.php/dav/customgroups/users/<$numericGroupId>/<$userId>

curl --silent \
  -X DELETE \
  --data "@" \
  -u username:password \
  'http://localhost//remote.php/dav/customgroups/users/&lt;$numericGroupId&gt;/&lt;$userId&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>

Change Admin Role of a Member

This endpoint allows for changing the admin role of an existing member of the group.

URI Request Type

PROPPATCH

/remote.php/dav/customgroups/users/<$numericGroupId>/<$userId>

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

Responses

Success
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>

List Group Memberships of a Given User

This endpoint lists the groups that a user is a member of.

URI Request Type

PROPFIND

/remote.php/dav/customgroups/users/<$userId>/<$membership>

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

Responses

Success

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.

<?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/users/settermjd/</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/users/settermjd/testgroup2/</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>
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>