- List user's groups
- List members of group
- Add user to group
- Get group membership
- Update group membership
- Remove user from group
Retrieves all the groups for a user. Only members of this group or users with admin-level permissions will be able to use this API.
This operation is performed by calling function getUserMemberships.
See the endpoint docs at API Reference.
client.getMemberships().getUserMemberships(user.getId())
- userId
String- The ID of the user. Example: "12345"
- queryParams
GetUserMembershipsQueryParams- Query parameters of getUserMemberships method
- headers
GetUserMembershipsHeaders- Headers of getUserMemberships method
This function returns a value of type GroupMemberships.
Returns a collection of membership objects. If there are no memberships, an empty collection will be returned.
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.
This operation is performed by calling function getGroupMemberships.
See the endpoint docs at API Reference.
client.getMemberships().getGroupMemberships(group.getId())
- groupId
String- The ID of the group. Example: "57645"
- queryParams
GetGroupMembershipsQueryParams- Query parameters of getGroupMemberships method
- headers
GetGroupMembershipsHeaders- Headers of getGroupMemberships method
This function returns a value of type GroupMemberships.
Returns a collection of membership objects. If there are no memberships, an empty collection will be returned.
Creates a group membership. Only users with admin-level permissions will be able to use this API.
This operation is performed by calling function createGroupMembership.
See the endpoint docs at API Reference.
client.getMemberships().createGroupMembership(new CreateGroupMembershipRequestBody(new CreateGroupMembershipRequestBodyUserField(user.getId()), new CreateGroupMembershipRequestBodyGroupField(group.getId())))
- requestBody
CreateGroupMembershipRequestBody- Request body of createGroupMembership method
- queryParams
CreateGroupMembershipQueryParams- Query parameters of createGroupMembership method
- headers
CreateGroupMembershipHeaders- Headers of createGroupMembership method
This function returns a value of type GroupMembership.
Returns a new group membership object.
Retrieves a specific group membership. Only admins of this group or users with admin-level permissions will be able to use this API.
This operation is performed by calling function getGroupMembershipById.
See the endpoint docs at API Reference.
client.getMemberships().getGroupMembershipById(groupMembership.getId())
- groupMembershipId
String- The ID of the group membership. Example: "434534"
- queryParams
GetGroupMembershipByIdQueryParams- Query parameters of getGroupMembershipById method
- headers
GetGroupMembershipByIdHeaders- Headers of getGroupMembershipById method
This function returns a value of type GroupMembership.
Returns the group membership object.
Updates a user's group membership. Only admins of this group or users with admin-level permissions will be able to use this API.
This operation is performed by calling function updateGroupMembershipById.
See the endpoint docs at API Reference.
client.getMemberships().updateGroupMembershipById(groupMembership.getId(), new UpdateGroupMembershipByIdRequestBody.Builder().role(UpdateGroupMembershipByIdRequestBodyRoleField.ADMIN).build())
- groupMembershipId
String- The ID of the group membership. Example: "434534"
- requestBody
UpdateGroupMembershipByIdRequestBody- Request body of updateGroupMembershipById method
- queryParams
UpdateGroupMembershipByIdQueryParams- Query parameters of updateGroupMembershipById method
- headers
UpdateGroupMembershipByIdHeaders- Headers of updateGroupMembershipById method
This function returns a value of type GroupMembership.
Returns a new group membership object.
Deletes a specific group membership. Only admins of this group or users with admin-level permissions will be able to use this API.
This operation is performed by calling function deleteGroupMembershipById.
See the endpoint docs at API Reference.
client.getMemberships().deleteGroupMembershipById(groupMembership.getId())
- groupMembershipId
String- The ID of the group membership. Example: "434534"
- headers
DeleteGroupMembershipByIdHeaders- Headers of deleteGroupMembershipById method
This function returns a value of type void.
A blank response is returned if the membership was successfully deleted.