Group Management API
Custom Groups
List Groups
This endpoint returns a list of all custom groups.
URI | Request Type |
---|---|
|
|
curl --silent \
-X PROPFIND \
--data "@list-custom-groups.xml" \
-u username:password \
'http://localhost/remote.php/dav/customgroups/groups/' \
| xmllint --format -
<?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:
-
An XML payload.
-
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 |
---|---|
|
|
curl --silent \
-X PROPPATCH \
--data "@rename-custom-group.xml" \
-u username:password \
'http://localhost/remote.php/dav/customgroups/groups/<$groupId>' \
| xmllint --format -
<?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 |
---|---|
|
|
curl --silent \
-X DELETE \
--data "@" \
-u username:password \
'http://localhost/remote.php/dav/customgroups/groups/<$groupId>' \
| 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 |
---|---|
|
|
curl --silent \
-X MKCOL \
--data "@" \
-u username:password \
'http://localhost/remote.php/dav/customgroups/groups/<$groupId>' \
| 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>
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 |
---|---|
|
|
curl --silent \
-X PROPFIND \
--data "@list-custom-group-members.xml" \
-u username:password \
'http://localhost//remote.php/dav/customgroups/users/' \
| xmllint --format -
<?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:
-
An XML payload.
-
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 |
---|---|
|
|
curl --silent \
-X PUT \
--data "@" \
-u username:password \
'http://localhost//remote.php/dav/customgroups/users/<$numericGroupId>/<$userId>' \
| xmllint --format -
Responses
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 |
---|---|
|
|
curl --silent \
-X DELETE \
--data "@" \
-u username:password \
'http://localhost//remote.php/dav/customgroups/users/<$numericGroupId>/<$userId>' \
| 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 |
---|---|
|
|
curl --silent \
-X PROPPATCH \
--data "@" \
-u username:password \
'http://localhost//remote.php/dav/customgroups/users/<$numericGroupId>/<$userId>' \
| xmllint --format -
Responses
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 |
---|---|
|
|
curl --silent \
-X PROPFIND \
--data "@" \
-u username:password \
'http://localhost//remote.php/dav/customgroups/users/<$userId>/<$membership>' \
| xmllint --format -
Responses
Success
Successful requests return two things:
-
An XML payload.
-
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>