Skip to main content

channel_bans

Creates, updates, deletes, gets or lists a channel_bans resource.

Overview​

Namechannel_bans
TypeResource
Idaws.chime_sdk_messaging.channel_bans

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
channel_arnstringThe ARN of the channel from which a member is being banned. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>)
created_byobjectThe details of a user or bot.
created_timestampstring (date-time)The time at which the ban was created.
memberobjectThe details of a user or bot.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_channel_banselectchannel_arn, member_arn, x-amz-chime-bearer, regionReturns the full details of a channel ban. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
list_channel_bansselectchannel_arn, x-amz-chime-bearer, regionmax-results, next-tokenLists all the users and bots banned from a particular channel. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
create_channel_baninsertchannel_arn, x-amz-chime-bearer, region, MemberArnPermanently bans a member from a channel. Moderators can't add banned members to a channel. To undo a ban, you first have to DeleteChannelBan, and then CreateChannelMembership. Bans are cleaned up when you delete users or channels. If you ban a user who is already part of a channel, that user is automatically kicked from the channel. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
delete_channel_bandeletechannel_arn, member_arn, x-amz-chime-bearer, regionRemoves a member from a channel's ban list. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
channel_arnstringThe ARN of the channel from which the AppInstanceUser was banned.
member_arnstringThe ARN of the AppInstanceUser that you want to reinstate.
regionstringAWS region (default: us-east-1)
x-amz-chime-bearerstringThe ARN of the AppInstanceUser or AppInstanceBot that makes the API call.
max-resultsintegerThe maximum number of bans that you want returned.
next-tokenstringThe token passed by previous API calls until all requested bans are returned.

SELECT examples​

Returns the full details of a channel ban. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

SELECT
channel_arn,
created_by,
created_timestamp,
member
FROM aws.chime_sdk_messaging.channel_bans
WHERE channel_arn = '{{ channel_arn }}' -- required
AND member_arn = '{{ member_arn }}' -- required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Permanently bans a member from a channel. Moderators can't add banned members to a channel. To undo a ban, you first have to DeleteChannelBan, and then CreateChannelMembership. Bans are cleaned up when you delete users or channels. If you ban a user who is already part of a channel, that user is automatically kicked from the channel. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

INSERT INTO aws.chime_sdk_messaging.channel_bans (
MemberArn,
channel_arn,
`x-amz-chime-bearer`,
region
)
SELECT
'{{ MemberArn }}' /* required */,
'{{ channel_arn }}',
'{{ x-amz-chime-bearer }}',
'{{ region }}'
RETURNING
channel_arn,
member
;

DELETE examples​

Removes a member from a channel's ban list. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

DELETE FROM aws.chime_sdk_messaging.channel_bans
WHERE channel_arn = '{{ channel_arn }}' --required
AND member_arn = '{{ member_arn }}' --required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' --required
AND region = '{{ region }}' --required
;