2022/06/06 - Amazon Chime SDK Messaging - 1 new 1 updated api methods
Changes This release adds support for searching channels by members via the SearchChannels API, removes required restrictions for Name and Mode in UpdateChannel API and enhances CreateChannel API by exposing member and moderator list as well as channel id as optional parameters.
Allows an AppInstanceUser to search the channels that they belong to. The AppInstanceUser can search by membership or external ID. An AppInstanceAdmin can search across all channels within the AppInstance .
See also: AWS API Documentation
Request Syntax
client.search_channels( ChimeBearer='string', Fields=[ { 'Key': 'MEMBERS', 'Values': [ 'string', ], 'Operator': 'EQUALS'|'INCLUDES' }, ], MaxResults=123, NextToken='string' )
string
The AppInstanceUserArn of the user making the API call.
list
[REQUIRED]
A list of the Field objects in the channel being searched.
(dict) --
A Field of the channel that you want to search.
Key (string) -- [REQUIRED]
An enum value that indicates the key to search the channel on. MEMBERS allows you to search channels based on memberships. You can use it with the EQUALS operator to get channels whose memberships are equal to the specified values, and with the INCLUDES operator to get channels whose memberships include the specified values.
Values (list) -- [REQUIRED]
The values that you want to search for, a list of strings. The values must be AppInstanceUserArns specified as a list of strings.
Note
This operation isn't supported for AppInstanceUsers with large number of memberships.
(string) --
Operator (string) -- [REQUIRED]
The operator used to compare field values, currently EQUALS or INCLUDES . Use the EQUALS operator to find channels whose memberships equal the specified values. Use the INCLUDES operator to find channels whose memberships include the specified values.
integer
The maximum number of channels that you want returned.
string
The token returned from previous API requests until the number of channels is reached.
dict
Response Syntax
{ 'Channels': [ { 'Name': 'string', 'ChannelArn': 'string', 'Mode': 'UNRESTRICTED'|'RESTRICTED', 'Privacy': 'PUBLIC'|'PRIVATE', 'Metadata': 'string', 'LastMessageTimestamp': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Channels (list) --
A list of the channels in the request.
(dict) --
Summary of the details of a Channel .
Name (string) --
The name of the channel.
ChannelArn (string) --
The ARN of the channel.
Mode (string) --
The mode of the channel.
Privacy (string) --
The privacy setting of the channel.
Metadata (string) --
The metadata of the channel.
LastMessageTimestamp (datetime) --
The time at which the last message in a channel was sent.
NextToken (string) --
The token returned from previous API responses until the number of channels is reached.
{'ChannelId': 'string', 'MemberArns': ['string'], 'ModeratorArns': ['string']}
Creates a channel to which you can add users and send messages.
Restriction : You can't change a channel's privacy.
Note
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.
See also: AWS API Documentation
Request Syntax
client.create_channel( AppInstanceArn='string', Name='string', Mode='UNRESTRICTED'|'RESTRICTED', Privacy='PUBLIC'|'PRIVATE', Metadata='string', ClientRequestToken='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ], ChimeBearer='string', ChannelId='string', MemberArns=[ 'string', ], ModeratorArns=[ 'string', ] )
string
[REQUIRED]
The ARN of the channel request.
string
[REQUIRED]
The name of the channel.
string
The channel mode: UNRESTRICTED or RESTRICTED . Administrators, moderators, and channel members can add themselves and other members to unrestricted channels. Only administrators and moderators can add members to restricted channels.
string
The channel's privacy level: PUBLIC or PRIVATE . Private channels aren't discoverable by users outside the channel. Public channels are discoverable by anyone in the AppInstance .
string
The metadata of the creation request. Limited to 1KB and UTF-8.
string
[REQUIRED]
The client token for the request. An Idempotency token.
This field is autopopulated if not provided.
list
The tags for the creation request.
(dict) --
A tag object containing a key-value pair.
Key (string) -- [REQUIRED]
The key in a tag.
Value (string) -- [REQUIRED]
The value in a tag.
string
[REQUIRED]
The AppInstanceUserArn of the user that makes the API call.
string
The ID of the channel in the request.
list
The ARNs of the channel members in the request.
(string) --
list
The ARNs of the channel moderators in the request.
(string) --
dict
Response Syntax
{ 'ChannelArn': 'string' }
Response Structure
(dict) --
ChannelArn (string) --
The ARN of the channel.