ChimeSDKMessaging / Client / search_channels
search_channels#
- ChimeSDKMessaging.Client.search_channels(**kwargs)#
Allows the
ChimeBearerto search channels by channel members. Users or bots can search across the channels that they belong to. Users in theAppInstanceAdminrole can search across all channels.The
x-amz-chime-bearerrequest header is mandatory. Use the ARN of theAppInstanceUserorAppInstanceBotthat 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
AppInstanceUserArnof the user making the API call.Fields (list) –
[REQUIRED]
A list of the
Fieldobjects in the channel being searched.(dict) –
A
Fieldof the channel that you want to search.Key (string) – [REQUIRED]
An
enumvalue that indicates the key to search the channel on.MEMBERSallows you to search channels based on memberships. You can use it with theEQUALSoperator to get channels whose memberships are equal to the specified values, and with theINCLUDESoperator 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
AppInstanceUserArnsspecified as a list of strings.Note
This operation isn’t supported for
AppInstanceUserswith large number of memberships.(string) –
Operator (string) – [REQUIRED]
The operator used to compare field values, currently
EQUALSorINCLUDES. Use theEQUALSoperator to find channels whose memberships equal the specified values. Use theINCLUDESoperator 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
ChimeSDKMessaging.Client.exceptions.BadRequestExceptionChimeSDKMessaging.Client.exceptions.ForbiddenExceptionChimeSDKMessaging.Client.exceptions.UnauthorizedClientExceptionChimeSDKMessaging.Client.exceptions.ThrottledClientExceptionChimeSDKMessaging.Client.exceptions.ServiceUnavailableExceptionChimeSDKMessaging.Client.exceptions.ServiceFailureException