Use these methods to manage group membership.
groups_subscriptions_api = client.groups_subscriptionsGroupsSubscriptionsApi
This method removes the authenticated user from the specified group. The authenticated user can't be the owner of the group; assign a new owner through a PATCH request first.
def leave_group_alt1(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. |
interact
interact
204: The user was removed from the group.
This method returns an ApiResponse instance.
group_id = 1108
result = groups_subscriptions_api.leave_group_alt1(group_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 403 | The authenticated user can't leave the group. | LegacyErrorException |
| 404 | Error code 5451: This resource is restricted in your region. | ErrorException |
This method adds the authenticated user to the specified group.
def join_group_alt1(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. |
interact
interact
204: The user joined the group.
This method returns an ApiResponse instance.
group_id = 1108
result = groups_subscriptions_api.join_group_alt1(group_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 403 | The authenticated user can't join the group. Possible reasons are that the group isn't public or that its privacy setting is members. |
LegacyErrorException |
| 404 | Error code 5451: This resource is restricted in your region. | ErrorException |
This method removes the authenticated user from the specified group. The authenticated user can't be the owner of the group; assign a new owner through a PATCH request first.
def leave_group(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. |
interact
interact
204: The user was removed from the group.
This method returns an ApiResponse instance.
group_id = 1108
user_id = 152184
result = groups_subscriptions_api.leave_group(
group_id,
user_id
)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 403 | The authenticated user can't leave the group. | LegacyErrorException |
| 404 | Error code 5451: This resource is restricted in your region. | ErrorException |
This method adds the authenticated user to the specified group.
def join_group(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. |
interact
interact
204: The user joined the group.
This method returns an ApiResponse instance.
group_id = 1108
user_id = 152184
result = groups_subscriptions_api.join_group(
group_id,
user_id
)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end| HTTP Status Code | Error Description | Exception Class |
|---|---|---|
| 403 | The authenticated user can't join the group. Possible reasons are that the group isn't public or that its privacy setting is members. |
LegacyErrorException |
| 404 | Error code 5451: This resource is restricted in your region. | ErrorException |