Use these methods to manage group members.
GroupsUsersApi groupsUsersApi = client.getGroupsUsersApi();GroupsUsersApi
- Get Group Members
- Get User Groups Alt 1
- Check if User Joined Group Alt 1
- Get User Groups
- Check if User Joined Group
This method returns every user who belongs to the specified group.
CompletableFuture<ApiResponse<List<User>>> getGroupMembersAsync(
final double groupId,
final Direction direction,
final Filter2 filter,
final Double page,
final Double perPage,
final String query,
final Sort8 sort)This endpoint requires oauth2_authorization_code OR oauth2_client_credentials
| Parameter | Type | Tags | Description |
|---|---|---|---|
groupId |
double |
Template, Required | The ID of the group. |
direction |
Direction |
Query, Optional | The sort direction of the results. Option descriptions: * asc - Sort the results in ascending order.* desc - Sort the results in descending order. |
filter |
Filter2 |
Query, Optional | The attribute by which to filter the results. Option descriptions: * moderators - Return group moderators. |
page |
Double |
Query, Optional | The page number of the results to show. |
perPage |
Double |
Query, Optional | The number of items to show on each page of results, up to a maximum of 100. |
query |
String |
Query, Optional | The search query to use to filter the results. |
sort |
Sort8 |
Query, Optional | The way to sort the results. Option descriptions: * alphabetical - Sort the results alphabetically.* date - Sort the results by creation date. |
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
200: The members were returned.
This method returns an ApiResponse instance. The getResult() getter of this instance returns the response data which is of type List<User>.
double groupId = 1108D;
Direction direction = Direction.ASC;
Double page = 1D;
Double perPage = 10D;
String query = "Stop motion";
groupsUsersApi.getGroupMembersAsync(groupId, direction, null, page, perPage, query, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
Throwable cause = exception.getCause();
if (cause instanceof LegacyErrorException) {
LegacyErrorException legacyErrorException = (LegacyErrorException) cause;
legacyErrorException.printStackTrace();
} else {
// fallback for unexpected errors
exception.printStackTrace();
}
return null;
});| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 404 | * No such group exists. * Error code 5451: This resource is restricted in your region. |
LegacyErrorException |
This method returns every group to which the authenticated user belongs.
CompletableFuture<ApiResponse<List<Group>>> getUserGroupsAlt1Async(
final Direction direction,
final Filter12 filter,
final Double page,
final Double perPage,
final String query,
final Sort5 sort)This endpoint requires oauth2_authorization_code OR oauth2_client_credentials
| Parameter | Type | Tags | Description |
|---|---|---|---|
direction |
Direction |
Query, Optional | The sort direction of the results. Option descriptions: * asc - Sort the results in ascending order.* desc - Sort the results in descending order. |
filter |
Filter12 |
Query, Optional | The attribute by which to filter the results. Option descriptions: * moderated - Return moderated groups. |
page |
Double |
Query, Optional | The page number of the results to show. |
perPage |
Double |
Query, Optional | The number of items to show on each page of results, up to a maximum of 100. |
query |
String |
Query, Optional | The search query to use to filter the results. |
sort |
Sort5 |
Query, Optional | The way to sort the results. Option descriptions: * alphabetical - Sort the results alphabetically.* date - Sort the results by creation date.* members - Sort the results by number of members.* videos - Sort the results by number of videos. |
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
200: The groups were returned.
This method returns an ApiResponse instance. The getResult() getter of this instance returns the response data which is of type List<Group>.
Direction direction = Direction.ASC;
Double page = 1D;
Double perPage = 10D;
String query = "Stop motion";
groupsUsersApi.getUserGroupsAlt1Async(direction, null, page, perPage, query, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
Throwable cause = exception.getCause();
if (cause instanceof ErrorException) {
ErrorException errorException = (ErrorException) cause;
errorException.printStackTrace();
} else {
// fallback for unexpected errors
exception.printStackTrace();
}
return null;
});| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 404 | Error code 5451: This resource is restricted in your region. | ErrorException |
This method determines whether the authenticated user belongs to the specified group.
CompletableFuture<ApiResponse<Void>> checkIfUserJoinedGroupAlt1Async(
final double groupId)This endpoint requires oauth2_authorization_code OR oauth2_client_credentials
| Parameter | Type | Tags | Description |
|---|---|---|---|
groupId |
double |
Template, Required | The ID of the group. |
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
204: The user belongs to the group.
void
double groupId = 1108D;
groupsUsersApi.checkIfUserJoinedGroupAlt1Async(groupId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
Throwable cause = exception.getCause();
if (cause instanceof LegacyErrorException) {
LegacyErrorException legacyErrorException = (LegacyErrorException) cause;
legacyErrorException.printStackTrace();
} else {
// fallback for unexpected errors
exception.printStackTrace();
}
return null;
});| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 404 | * No such group exists. * The authenticated user isn't a member of the group. * Error code 5451: This resource is restricted in your region. |
LegacyErrorException |
This method returns every group to which the authenticated user belongs.
CompletableFuture<ApiResponse<List<Group>>> getUserGroupsAsync(
final double userId,
final Direction direction,
final Filter12 filter,
final Double page,
final Double perPage,
final String query,
final Sort5 sort)This endpoint requires oauth2_authorization_code OR oauth2_client_credentials
| Parameter | Type | Tags | Description |
|---|---|---|---|
userId |
double |
Template, Required | The ID of the user. |
direction |
Direction |
Query, Optional | The sort direction of the results. Option descriptions: * asc - Sort the results in ascending order.* desc - Sort the results in descending order. |
filter |
Filter12 |
Query, Optional | The attribute by which to filter the results. Option descriptions: * moderated - Return moderated groups. |
page |
Double |
Query, Optional | The page number of the results to show. |
perPage |
Double |
Query, Optional | The number of items to show on each page of results, up to a maximum of 100. |
query |
String |
Query, Optional | The search query to use to filter the results. |
sort |
Sort5 |
Query, Optional | The way to sort the results. Option descriptions: * alphabetical - Sort the results alphabetically.* date - Sort the results by creation date.* members - Sort the results by number of members.* videos - Sort the results by number of videos. |
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
200: The groups were returned.
This method returns an ApiResponse instance. The getResult() getter of this instance returns the response data which is of type List<Group>.
double userId = 152184D;
Direction direction = Direction.ASC;
Double page = 1D;
Double perPage = 10D;
String query = "Stop motion";
groupsUsersApi.getUserGroupsAsync(userId, direction, null, page, perPage, query, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
Throwable cause = exception.getCause();
if (cause instanceof ErrorException) {
ErrorException errorException = (ErrorException) cause;
errorException.printStackTrace();
} else {
// fallback for unexpected errors
exception.printStackTrace();
}
return null;
});| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 404 | Error code 5451: This resource is restricted in your region. | ErrorException |
This method determines whether the authenticated user belongs to the specified group.
CompletableFuture<ApiResponse<Void>> checkIfUserJoinedGroupAsync(
final double groupId,
final double userId)This endpoint requires oauth2_authorization_code OR oauth2_client_credentials
| Parameter | Type | Tags | Description |
|---|---|---|---|
groupId |
double |
Template, Required | The ID of the group. |
userId |
double |
Template, Required | The ID of the user. |
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
ai, create, delete, edit, email, interact, private, promo_codes, public, purchase, purchased, scim, stats, upload, video_files
204: The user belongs to the group.
void
double groupId = 1108D;
double userId = 152184D;
groupsUsersApi.checkIfUserJoinedGroupAsync(groupId, userId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
Throwable cause = exception.getCause();
if (cause instanceof LegacyErrorException) {
LegacyErrorException legacyErrorException = (LegacyErrorException) cause;
legacyErrorException.printStackTrace();
} else {
// fallback for unexpected errors
exception.printStackTrace();
}
return null;
});| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 404 | * No such group exists. * The authenticated user isn't a member of the group. * Error code 5451: This resource is restricted in your region. |
LegacyErrorException |