groups/{groupid}/users (GET)
Overview
Return a list of users in a group
- REST Method: GET
- Method Access: public
Uri Parameters
Name | Type | Description |
groupid | string | either an integer group ID or "=" followed by a double uri-encoded group name |
Query Parameters
Name | Type | Description |
sortby | {id, username, nick, email, fullname, date.lastlogin, status, role, service}? | Sort field. Prefix value with '-' to sort descending. default: No sorting |
authenticate | bool? | Force authentication for request (default: false) |
activatedfilter | bool? | Search for users by their active status |
rolefilter | string? | Search for users by a role name |
usernamefilter | string? | Search for users by name or part of a name |
limit | string? | Maximum number of items to retrieve. Must be a positive number or 'all' to retrieve all items. (default: 100) |
offset | int? | Number of items to skip. Must be a positive number or 0 to not skip any. (default: 0) |
Return Codes
Name | Value | Description |
OK | 200 | Request completed successfully |
Bad Request | 400 | Invalid input parameter or request body |
Forbidden | 403 | Read access is required |
Not Found | 404 | Requested group could not be found |
Message Format
Output:
<users count="{int}" href="{uri}"> <user id="{int}" href="{uri}"> <nick>{text}</nick> <username>{text}</username> <email>{text}</email> </user> ... </users>
Implementation Notes
Groups provide the ability to associate a collection of users with a predefined role.
C# Code Sample: Retrieve Group Users
The following code example retrieves the users in the group with ID 1:
Sample Code
Plug p = Plug.New("http://deki-hayes/@api/deki"); p.At("users", "authenticate").WithCredentials("admin", "password").Get(); p.At("groups", "1", "users").Get();
Sample Response from executing Code
Sample response indicating that the group contains the user "user1":
<users count="1" href="http://deki-hayes/@api/deki/groups/1/users"> <user id="3" href="http://deki-hayes/@api/deki/users/3"> <nick>user1</nick> <username>user1</username> <email>user1@mindtouch.com</email> </user> </users>
Implementation notes
Add notes about requirements or config values
Curl Code Sample: Retrieve Group Users
The following command retrieves a list of users who are members of group "foo":
Sample Code
curl -u username:password -i http://mindtouch.address/@api/deki/groups/=foo/users
Sample Response from executing Code
group_name = test, group has 3 users
Content-Type: application/xml
<users count="3" querycount="3" totalcount="3" href="http://192.168.59.128/@api/deki/groups/22/users"> <user id="83" href="http://192.168.59.128/@api/deki/users/83"> <nick>test3</nick> <username>test3</username> <email hidden="true"/> <hash.email>b7eb0bea5420aa6a566d3cebe69e2a15</hash.email> <uri.gravatar>http://www.gravatar.com/avatar/b7eb0bea5420aa6a566d3cebe69e2a15</uri.gravatar> </user> <user id="82" href="http://192.168.59.128/@api/deki/users/82"> <nick>test2</nick> <username>test2</username> <email hidden="true"/> <hash.email>f5fc800a80fa8a5f290396ed1f10e326</hash.email> <uri.gravatar>http://www.gravatar.com/avatar/f5fc800a80fa8a5f290396ed1f10e326</uri.gravatar> </user> <user id="3" href="http://192.168.59.128/@api/deki/users/3"> <nick>test</nick> <username>test</username> <email hidden="true"/> <hash.email>f561aaf6ef0bf14d4208bb46a4ccb3ad</hash.email> <uri.gravatar>http://www.gravatar.com/avatar/f561aaf6ef0bf14d4208bb46a4ccb3ad</uri.gravatar> </user> </users>
Implementation notes
curl flags
- -u
- Provides external user authentication. Note that if anonymous access is available and authentication is not forced, this flag may be omitted.
- -i
- Outputs the HTTP response headers. Useful for debugging.
Groups
- To view a list of all groups, follow the instructions here.