Skip to main content

channel_memberships

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

Overview

Namechannel_memberships
TypeResource
Idaws.chime_sdk_messaging.channel_memberships

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
channel_arnstringThe ARN of the member's channel. (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_timestampstring (date-time)The time at which the channel membership was created.
invited_byobjectThe details of a user or bot.
last_updated_timestampstring (date-time)The time at which a channel membership was last updated.
memberobjectThe details of a user or bot.
sub_channel_idstringThe ID of the SubChannel that a user belongs to. (pattern: <code>[-_a-zA-Z0-9]*</code>)
typestringThe membership type set for the channel member. (DEFAULT, HIDDEN)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_channel_membershipselectchannel_arn, member_arn, x-amz-chime-bearer, regionsub-channel-idReturns the full details of a user's channel membership. 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_membershipsselectchannel_arn, x-amz-chime-bearer, regiontype, max-results, next-token, sub-channel-idLists all channel memberships in a 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. If you want to list the channels to which a specific app instance user belongs, see the ListChannelMembershipsForAppInstanceUser API.
create_channel_membershipinsertchannel_arn, x-amz-chime-bearer, region, MemberArn, TypeAdds a member to a channel. The InvitedBy field in ChannelMembership is derived from the request header. A channel member can: List messages Send messages Receive messages Edit their own messages Leave the channel Privacy settings impact this action as follows: Public Channels: You do not need to be a member to list messages, but you must be a member to send messages. Private Channels: You must be a member to list or send messages. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUserArn or AppInstanceBot that makes the API call as the value in the header.
delete_channel_membershipdeletechannel_arn, member_arn, x-amz-chime-bearer, regionsub-channel-idRemoves a member from a channel. The x-amz-chime-bearer request header is mandatory. Use the AppInstanceUserArn of the user 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 you want to remove the user.
member_arnstringThe AppInstanceUserArn of the member that you're removing from the channel.
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 channel memberships that you want returned.
next-tokenstringThe token passed by previous API calls until all requested channel memberships are returned.
sub-channel-idstringThe ID of the SubChannel in the request. Only for use by moderators.
typestringThe membership type of a user, DEFAULT or HIDDEN. Default members are returned as part of ListChannelMemberships if no type is specified. Hidden members are only returned if the type filter in ListChannelMemberships equals HIDDEN.

SELECT examples

Returns the full details of a user's channel membership. 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_timestamp,
invited_by,
last_updated_timestamp,
member,
sub_channel_id,
type
FROM aws.chime_sdk_messaging.channel_memberships
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
AND `sub-channel-id` = '{{ sub-channel-id }}'
;

INSERT examples

Adds a member to a channel. The InvitedBy field in ChannelMembership is derived from the request header. A channel member can: List messages Send messages Receive messages Edit their own messages Leave the channel Privacy settings impact this action as follows: Public Channels: You do not need to be a member to list messages, but you must be a member to send messages. Private Channels: You must be a member to list or send messages. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUserArn or AppInstanceBot that makes the API call as the value in the header.

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

DELETE examples

Removes a member from a channel. The x-amz-chime-bearer request header is mandatory. Use the AppInstanceUserArn of the user that makes the API call as the value in the header.

DELETE FROM aws.chime_sdk_messaging.channel_memberships
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
AND `sub-channel-id` = '{{ sub-channel-id }}'
;