channel_memberships
Creates, updates, deletes, gets or lists a channel_memberships resource.
Overview
| Name | channel_memberships |
| Type | Resource |
| Id | aws.chime_sdk_messaging.channel_memberships |
Fields
The following fields are returned by SELECT queries:
- describe_channel_membership
- list_channel_memberships
| Name | Datatype | Description |
|---|---|---|
channel_arn | string | The 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_timestamp | string (date-time) | The time at which the channel membership was created. |
invited_by | object | The details of a user or bot. |
last_updated_timestamp | string (date-time) | The time at which a channel membership was last updated. |
member | object | The details of a user or bot. |
sub_channel_id | string | The ID of the SubChannel that a user belongs to. (pattern: <code>[-_a-zA-Z0-9]*</code>) |
type | string | The membership type set for the channel member. (DEFAULT, HIDDEN) |
| Name | Datatype | Description |
|---|---|---|
channel_arn | string | The ARN of the 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>) |
channel_memberships | array | The information for the requested channel memberships. |
next_token | string | The token passed by previous API calls until all requested channel memberships are returned. (pattern: <code>.*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_channel_membership | select | channel_arn, member_arn, x-amz-chime-bearer, region | sub-channel-id | 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. |
list_channel_memberships | select | channel_arn, x-amz-chime-bearer, region | type, max-results, next-token, sub-channel-id | Lists 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_membership | insert | channel_arn, x-amz-chime-bearer, region, MemberArn, Type | 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. | |
delete_channel_membership | delete | channel_arn, member_arn, x-amz-chime-bearer, region | sub-channel-id | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
channel_arn | string | The ARN of the channel from which you want to remove the user. |
member_arn | string | The AppInstanceUserArn of the member that you're removing from the channel. |
region | string | AWS region (default: us-east-1) |
x-amz-chime-bearer | string | The ARN of the AppInstanceUser or AppInstanceBot that makes the API call. |
max-results | integer | The maximum number of channel memberships that you want returned. |
next-token | string | The token passed by previous API calls until all requested channel memberships are returned. |
sub-channel-id | string | The ID of the SubChannel in the request. Only for use by moderators. |
type | string | The 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
- describe_channel_membership
- list_channel_memberships
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 }}'
;
Lists 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.
SELECT
channel_arn,
channel_memberships,
next_token
FROM aws.chime_sdk_messaging.channel_memberships
WHERE channel_arn = '{{ channel_arn }}' -- required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' -- required
AND region = '{{ region }}' -- required
AND type = '{{ type }}'
AND `max-results` = '{{ max-results }}'
AND `next-token` = '{{ next-token }}'
AND `sub-channel-id` = '{{ sub-channel-id }}'
;
INSERT examples
- create_channel_membership
- Manifest
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
;
# Description fields are for documentation purposes
- name: channel_memberships
props:
- name: channel_arn
value: "{{ channel_arn }}"
description: Required parameter for the channel_memberships resource.
- name: x-amz-chime-bearer
value: "{{ x-amz-chime-bearer }}"
description: Required parameter for the channel_memberships resource.
- name: region
value: "{{ region }}"
description: Required parameter for the channel_memberships resource.
- name: MemberArn
value: "{{ MemberArn }}"
- name: Type
value: "{{ Type }}"
valid_values: ['DEFAULT', 'HIDDEN']
- name: SubChannelId
value: "{{ SubChannelId }}"
DELETE examples
- delete_channel_membership
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 }}'
;