ChimeSDKMessaging / Client / search_channels
search_channels#
- ChimeSDKMessaging.Client.search_channels(**kwargs)#
Allows the
ChimeBearer
to search channels by channel members. Users or bots can search across the channels that they belong to. Users in theAppInstanceAdmin
role can search across all channels.The
x-amz-chime-bearer
request header is mandatory. Use the ARN of theAppInstanceUser
orAppInstanceBot
that makes the API call as the value in the header.See also: AWS API Documentation
Request Syntax
response = client.search_channels( ChimeBearer='string', Fields=[ { 'Key': 'MEMBERS', 'Values': [ 'string', ], 'Operator': 'EQUALS'|'INCLUDES' }, ], MaxResults=123, NextToken='string' )
- Parameters:
ChimeBearer (string) – The
AppInstanceUserArn
of the user making the API call.Fields (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 theEQUALS
operator to get channels whose memberships are equal to the specified values, and with theINCLUDES
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
orINCLUDES
. Use theEQUALS
operator to find channels whose memberships equal the specified values. Use theINCLUDES
operator to find channels whose memberships include the specified values.
MaxResults (integer) – The maximum number of channels that you want returned.
NextToken (string) – The token returned from previous API requests until the number of channels is reached.
- Return type:
dict
- Returns:
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 persistent message visible to the caller in a channel was sent.
NextToken (string) –
The token returned from previous API responses until the number of channels is reached.
Exceptions