Amazon Chime SDK Messaging

2022/06/06 - Amazon Chime SDK Messaging - 1 new1 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.

SearchChannels (new) Link ¶

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'
)
type ChimeBearer:

string

param ChimeBearer:

The AppInstanceUserArn of the user making the API call.

type Fields:

list

param Fields:

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

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

type MaxResults:

integer

param MaxResults:

The maximum number of channels that you want returned.

type NextToken:

string

param NextToken:

The token returned from previous API requests until the number of channels is reached.

rtype:

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 message in a channel was sent.

    • NextToken (string) --

      The token returned from previous API responses until the number of channels is reached.

CreateChannel (updated) Link ¶
Changes (request)
{'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.

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',
    ]
)
type AppInstanceArn:

string

param AppInstanceArn:

[REQUIRED]

The ARN of the channel request.

type Name:

string

param Name:

[REQUIRED]

The name of the channel.

type Mode:

string

param Mode:

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.

type Privacy:

string

param Privacy:

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.

type Metadata:

string

param Metadata:

The metadata of the creation request. Limited to 1KB and UTF-8.

type ClientRequestToken:

string

param ClientRequestToken:

[REQUIRED]

The client token for the request. An Idempotency token.

This field is autopopulated if not provided.

type Tags:

list

param Tags:

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.

type ChimeBearer:

string

param ChimeBearer:

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type ChannelId:

string

param ChannelId:

The ID of the channel in the request.

type MemberArns:

list

param MemberArns:

The ARNs of the channel members in the request.

  • (string) --

type ModeratorArns:

list

param ModeratorArns:

The ARNs of the channel moderators in the request.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ChannelArn': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel.