Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.7 KB

groups.md

File metadata and controls

60 lines (42 loc) · 1.7 KB

Groups

Groups are sets of users that can be used in collaborations.

Get All Groups

Calling the static getAllGroups(BoxAPIConnection) will return an iterable that will page through all of the user's groups.

Iterable<BoxGroup.Info> groups = BoxGroup.getAllGroups(BoxAPIConnection api);
for (BoxGroup.Info groupInfo : groups) {
    // Do something with the group.
}

Create a Group

The static createGroup(BoxAPIConnection, String) method will let you create a new group with a specified name.

BoxGroup.Info groupInfo = BoxGroup.createGroup(api, "My Group");

Delete a Group

A group can be deleted by calling the delete() method.

BoxGroup group = new BoxGroup(api, "id");
group.delete();

Get a Groups collaborations

A groups collaborations can be retrieved by calling the [getCollaborations()get-collaborations method.

BoxGroup group = new BoxGroup(api, "id");
group.getCollaborations();