Retrieves all the members for a group. Only members of this group or users with admin-level permissions will be able to use this API.
57645
The ID of the group.
1000
1000
The maximum number of items to return per page.
1000
0
The offset of the item at which to begin the response.
Queries with offset parameter value exceeding 10000 will be rejected with a 400 response.
Returns a collection of membership objects. If there are no memberships, an empty collection will be returned.
An unexpected client error.
curl -i -X GET "https://api.box.com/2.0/groups/57645/memberships" \
-H "authorization: Bearer <ACCESS_TOKEN>"
await client.memberships.getGroupMemberships(group.id);
client.memberships.get_group_memberships(group.id)
await client.Memberships.GetGroupMembershipsAsync(groupId: group.Id);
BoxGroup group = new BoxGroup(api, id);
Iterable<BoxGroupMembership.Info> memberships = group.getAllMemberships();
for (BoxGroupMembership.Info membershipInfo : memberships) {
// Do something with the membership.
}
group_memberships = client.group(group_id='11111').get_memberships()
for membership in group_memberships:
print(f'{membership.user.name} is a {membership.role} of the {membership.group.name} group')
BoxCollection<BoxGroupMembership> memberships = await client.GroupsManager
.GetAllGroupMembershipsForGroupAsync("11111");
client.groups.getMemberships('11111')
.then(memberships => {
/* memberships -> {
total_count: 2,
entries:
[ { type: 'group_membership',
id: '44444',
user:
{ type: 'user',
id: '22222',
name: 'Alice',
login: 'alice@example.com' },
group: { type: 'group', id: '11111', name: 'Employees' },
role: 'member' },
{ type: 'group_membership',
id: '55555',
user:
{ type: 'user',
id: '66666',
name: 'White Rabbit',
login: 'rabbit@example.com' },
group: { type: 'group', id: '11111', name: 'Employees' },
role: 'member' } ],
offset: 0,
limit: 100 }
*/
});
let iterator = client.groups.listMembership(groupId: "12345")
iterator.next { result in
switch results {
case let .success(page):
for membership in page.entries {
print("Group Membership with ID \(membership.id) was retrieved")
}
case let .failure(error):
print(error)
}
}
{
"entries": [
{
"created_at": "2012-12-12T10:53:43-08:00",
"group": {
"id": "11446498",
"type": "group",
"group_type": "managed_group",
"name": "Support"
},
"id": "11446498",
"modified_at": "2012-12-12T10:53:43-08:00",
"role": "member",
"type": "group_membership",
"user": {
"id": "11446498",
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
}
}
],
"limit": 1000,
"offset": 2000,
"order": [
{
"by": "type",
"direction": "ASC"
}
],
"total_count": 5000
}