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 the AppInstanceAdmin role can search across all channels.

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.

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 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.

  • 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.BadRequestException

  • ChimeSDKMessaging.Client.exceptions.ForbiddenException

  • ChimeSDKMessaging.Client.exceptions.UnauthorizedClientException

  • ChimeSDKMessaging.Client.exceptions.ThrottledClientException

  • ChimeSDKMessaging.Client.exceptions.ServiceUnavailableException

  • ChimeSDKMessaging.Client.exceptions.ServiceFailureException