Use these methods to manage group members.
groups_users_api = client.groups_usersGroupsUsersApi
- 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.
def get_group_members(self,
group_id,
direction=None,
filter=None,
page=None,
per_page=None,
query=None,
sort=None)This endpoint requires oauth2_authorization_code OR oauth2_client_credentials
| Parameter | Type | Tags | Description |
|---|---|---|---|
group_id |
float |
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 |
float |
Query, Optional | The page number of the results to show. |
per_page |
float |
Query, Optional | The number of items to show on each page of results, up to a maximum of 100. |
query |
str |
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 body property of this instance returns the response data which is of type List[User].
group_id = 1108
direction = Direction.ASC
page = 1
per_page = 10
query = 'Stop motion'
result = groups_users_api.get_group_members(
group_id,
direction=direction,
page=page,
per_page=per_page,
query=query
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)| 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.
def get_user_groups_alt_1(self,
direction=None,
filter=None,
page=None,
per_page=None,
query=None,
sort=None)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 |
float |
Query, Optional | The page number of the results to show. |
per_page |
float |
Query, Optional | The number of items to show on each page of results, up to a maximum of 100. |
query |
str |
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 body property of this instance returns the response data which is of type List[Group].
direction = Direction.ASC
page = 1
per_page = 10
query = 'Stop motion'
result = groups_users_api.get_user_groups_alt_1(
direction=direction,
page=page,
per_page=per_page,
query=query
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)| 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.
def check_if_user_joined_group_alt_1(self,
group_id)This endpoint requires oauth2_authorization_code OR oauth2_client_credentials
| Parameter | Type | Tags | Description |
|---|---|---|---|
group_id |
float |
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.
This method returns an ApiResponse instance.
group_id = 1108
result = groups_users_api.check_if_user_joined_group_alt_1(group_id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)| 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.
def get_user_groups(self,
user_id,
direction=None,
filter=None,
page=None,
per_page=None,
query=None,
sort=None)This endpoint requires oauth2_authorization_code OR oauth2_client_credentials
| Parameter | Type | Tags | Description |
|---|---|---|---|
user_id |
float |
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 |
float |
Query, Optional | The page number of the results to show. |
per_page |
float |
Query, Optional | The number of items to show on each page of results, up to a maximum of 100. |
query |
str |
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 body property of this instance returns the response data which is of type List[Group].
user_id = 152184
direction = Direction.ASC
page = 1
per_page = 10
query = 'Stop motion'
result = groups_users_api.get_user_groups(
user_id,
direction=direction,
page=page,
per_page=per_page,
query=query
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)| 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.
def check_if_user_joined_group(self,
group_id,
user_id)This endpoint requires oauth2_authorization_code OR oauth2_client_credentials
| Parameter | Type | Tags | Description |
|---|---|---|---|
group_id |
float |
Template, Required | The ID of the group. |
user_id |
float |
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.
This method returns an ApiResponse instance.
group_id = 1108
user_id = 152184
result = groups_users_api.check_if_user_joined_group(
group_id,
user_id
)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)| 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 |