Amazon Chime SDK Messaging

2022/08/12 - Amazon Chime SDK Messaging - 1 new 19 updated api methods

Changes  The Amazon Chime SDK now supports channels with up to one million participants with elastic channels.

ListSubChannels (new) Link ¶

Lists all the SubChannels in an elastic channel when given a channel ID. Available only to the app instance admins and channel moderators of elastic channels.

See also: AWS API Documentation

Request Syntax

client.list_sub_channels(
    ChannelArn='string',
    ChimeBearer='string',
    MaxResults=123,
    NextToken='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of elastic channel.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user making the API call.

type MaxResults

integer

param MaxResults

The maximum number of sub-channels that you want to return.

type NextToken

string

param NextToken

The token passed by previous API calls until all requested sub-channels are returned.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string',
    'SubChannels': [
        {
            'SubChannelId': 'string',
            'MembershipCount': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of elastic channel.

    • SubChannels (list) --

      The information about each sub-channel.

      • (dict) --

        Summary of the sub-channels associated with the elastic channel.

        • SubChannelId (string) --

          The unique ID of a SubChannel.

        • MembershipCount (integer) --

          The number of members in a SubChannel.

    • NextToken (string) --

      The token passed by previous API calls until all requested sub-channels are returned.

BatchCreateChannelMembership (updated) Link ¶
Changes (request, response)
Request
{'SubChannelId': 'string'}
Response
{'BatchChannelMemberships': {'SubChannelId': 'string'}}

Adds a specified number of users to a channel.

See also: AWS API Documentation

Request Syntax

client.batch_create_channel_membership(
    ChannelArn='string',
    Type='DEFAULT'|'HIDDEN',
    MemberArns=[
        'string',
    ],
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel to which you're adding users.

type Type

string

param Type

The membership type of a user, DEFAULT or HIDDEN . Default members are always returned as part of ListChannelMemberships . Hidden members are only returned if the type filter in ListChannelMemberships equals HIDDEN . Otherwise hidden members are not returned. This is only supported by moderators.

type MemberArns

list

param MemberArns

[REQUIRED]

The AppInstanceUserArn s of the members you want to add to the channel.

  • (string) --

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

Note

Only required when creating membership in a SubChannel for a moderator in an elastic channel.

rtype

dict

returns

Response Syntax

{
    'BatchChannelMemberships': {
        'InvitedBy': {
            'Arn': 'string',
            'Name': 'string'
        },
        'Type': 'DEFAULT'|'HIDDEN',
        'Members': [
            {
                'Arn': 'string',
                'Name': 'string'
            },
        ],
        'ChannelArn': 'string',
        'SubChannelId': 'string'
    },
    'Errors': [
        {
            'MemberArn': 'string',
            'ErrorCode': 'BadRequest'|'Conflict'|'Forbidden'|'NotFound'|'PreconditionFailed'|'ResourceLimitExceeded'|'ServiceFailure'|'AccessDenied'|'ServiceUnavailable'|'Throttled'|'Throttling'|'Unauthorized'|'Unprocessable'|'VoiceConnectorGroupAssociationsExist'|'PhoneNumberAssociationsExist',
            'ErrorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • BatchChannelMemberships (dict) --

      The list of channel memberships in the response.

      • InvitedBy (dict) --

        The identifier of the member who invited another member.

        • Arn (string) --

          The ARN in an Identity.

        • Name (string) --

          The name in an Identity.

      • Type (string) --

        The membership types set for the channel users.

      • Members (list) --

        The users successfully added to the request.

        • (dict) --

          The details of a user.

          • Arn (string) --

            The ARN in an Identity.

          • Name (string) --

            The name in an Identity.

      • ChannelArn (string) --

        The ARN of the channel to which you're adding users.

      • SubChannelId (string) --

        The ID of the SubChannel.

    • Errors (list) --

      If the action fails for one or more of the memberships in the request, a list of the memberships is returned, along with error codes and error messages.

      • (dict) --

        A list of failed member ARNs, error codes, and error messages.

        • MemberArn (string) --

          The AppInstanceUserArn of the member that the service couldn't add.

        • ErrorCode (string) --

          The error code.

        • ErrorMessage (string) --

          The error message.

ChannelFlowCallback (updated) Link ¶
Changes (request)
{'ChannelMessage': {'SubChannelId': 'string'}}

Calls back Chime SDK Messaging with a processing response message. This should be invoked from the processor Lambda. This is a developer API.

You can return one of the following processing responses:

  • Update message content or metadata

  • Deny a message

  • Make no changes to the message

See also: AWS API Documentation

Request Syntax

client.channel_flow_callback(
    CallbackId='string',
    ChannelArn='string',
    DeleteResource=True|False,
    ChannelMessage={
        'MessageId': 'string',
        'Content': 'string',
        'Metadata': 'string',
        'PushNotification': {
            'Title': 'string',
            'Body': 'string',
            'Type': 'DEFAULT'|'VOIP'
        },
        'MessageAttributes': {
            'string': {
                'StringValues': [
                    'string',
                ]
            }
        },
        'SubChannelId': 'string'
    }
)
type CallbackId

string

param CallbackId

[REQUIRED]

The identifier passed to the processor by the service when invoked. Use the identifier to call back the service.

This field is autopopulated if not provided.

type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel.

type DeleteResource

boolean

param DeleteResource

When a processor determines that a message needs to be DENIED , pass this parameter with a value of true.

type ChannelMessage

dict

param ChannelMessage

[REQUIRED]

Stores information about the processed message.

  • MessageId (string) -- [REQUIRED]

    The message ID.

  • Content (string) --

    The message content.

  • Metadata (string) --

    The message metadata.

  • PushNotification (dict) --

    The push notification configuration of the message.

    • Title (string) --

      The title of the push notification.

    • Body (string) --

      The body of the push notification.

    • Type (string) --

      Enum value that indicates the type of the push notification for a message. DEFAULT : Normal mobile push notification. VOIP : VOIP mobile push notification.

  • MessageAttributes (dict) --

    The attributes for the message, used for message filtering along with a FilterRule defined in the PushNotificationPreferences .

    • (string) --

      • (dict) --

        A list of message attribute values.

        • StringValues (list) --

          The strings in a message attribute value.

          • (string) --

  • SubChannelId (string) --

    The ID of the SubChannel.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string',
    'CallbackId': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel.

    • CallbackId (string) --

      The call back ID passed in the request.

CreateChannel (updated) Link ¶
Changes (request)
{'ElasticChannelConfiguration': {'MaximumSubChannels': 'integer',
                                 'MinimumMembershipPercentage': 'integer',
                                 'TargetMembershipsPerSubChannel': 'integer'}}

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',
    ],
    ElasticChannelConfiguration={
        'MaximumSubChannels': 123,
        'TargetMembershipsPerSubChannel': 123,
        'MinimumMembershipPercentage': 123
    }
)
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) --

type ElasticChannelConfiguration

dict

param ElasticChannelConfiguration

The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of 1-million users, excluding moderators.

  • MaximumSubChannels (integer) -- [REQUIRED]

    The maximum number of SubChannels that you want to allow in the elastic channel.

  • TargetMembershipsPerSubChannel (integer) -- [REQUIRED]

    The maximum number of members allowed in a SubChannel.

  • MinimumMembershipPercentage (integer) -- [REQUIRED]

    The minimum allowed percentage of TargetMembershipsPerSubChannel users. Ceil of the calculated value is used in balancing members among SubChannels of the elastic channel.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel.

CreateChannelMembership (updated) Link ¶
Changes (both)
{'SubChannelId': 'string'}

Adds a user to a channel. The InvitedBy field in ChannelMembership is derived from the request header. A channel member can:

  • List messages

  • Send messages

  • Receive messages

  • Edit their own messages

  • Leave the channel

Privacy settings impact this action as follows:

  • Public Channels: You do not need to be a member to list messages, but you must be a member to send messages.

  • Private Channels: You must be a member to list or send messages.

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_membership(
    ChannelArn='string',
    MemberArn='string',
    Type='DEFAULT'|'HIDDEN',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel to which you're adding users.

type MemberArn

string

param MemberArn

[REQUIRED]

The AppInstanceUserArn of the member you want to add to the channel.

type Type

string

param Type

[REQUIRED]

The membership type of a user, DEFAULT or HIDDEN . Default members are always returned as part of ListChannelMemberships . Hidden members are only returned if the type filter in ListChannelMemberships equals HIDDEN . Otherwise hidden members are not returned. This is only supported by moderators.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

Note

Only required when creating membership in a SubChannel for a moderator in an elastic channel.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string',
    'Member': {
        'Arn': 'string',
        'Name': 'string'
    },
    'SubChannelId': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel.

    • Member (dict) --

      The ARN and metadata of the member being added.

      • Arn (string) --

        The ARN in an Identity.

      • Name (string) --

        The name in an Identity.

    • SubChannelId (string) --

      The ID of the SubChannel in the response.

DeleteChannel (updated) Link ¶
Changes (request)
{'SubChannelId': 'string'}

Immediately makes a channel and its memberships inaccessible and marks them for deletion. This is an irreversible process.

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.delete_channel(
    ChannelArn='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel being deleted.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

returns

None

DeleteChannelMembership (updated) Link ¶
Changes (request)
{'SubChannelId': 'string'}

Removes a member from a channel.

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.delete_channel_membership(
    ChannelArn='string',
    MemberArn='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel from which you want to remove the user.

type MemberArn

string

param MemberArn

[REQUIRED]

The AppInstanceUserArn of the member that you're removing from the channel.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

Note

Only for use by moderators.

returns

None

DeleteChannelMessage (updated) Link ¶
Changes (request)
{'SubChannelId': 'string'}

Deletes a channel message. Only admins can perform this action. Deletion makes messages inaccessible immediately. A background process deletes any revisions created by UpdateChannelMessage .

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.delete_channel_message(
    ChannelArn='string',
    MessageId='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel.

type MessageId

string

param MessageId

[REQUIRED]

The ID of the message being deleted.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

Note

Only required when deleting messages in a SubChannel that the user belongs to.

returns

None

DescribeChannel (updated) Link ¶
Changes (response)
{'Channel': {'ElasticChannelConfiguration': {'MaximumSubChannels': 'integer',
                                             'MinimumMembershipPercentage': 'integer',
                                             'TargetMembershipsPerSubChannel': 'integer'}}}

Returns the full details of a channel in an Amazon Chime AppInstance .

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.describe_channel(
    ChannelArn='string',
    ChimeBearer='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

rtype

dict

returns

Response Syntax

{
    'Channel': {
        'Name': 'string',
        'ChannelArn': 'string',
        'Mode': 'UNRESTRICTED'|'RESTRICTED',
        'Privacy': 'PUBLIC'|'PRIVATE',
        'Metadata': 'string',
        'CreatedBy': {
            'Arn': 'string',
            'Name': 'string'
        },
        'CreatedTimestamp': datetime(2015, 1, 1),
        'LastMessageTimestamp': datetime(2015, 1, 1),
        'LastUpdatedTimestamp': datetime(2015, 1, 1),
        'ChannelFlowArn': 'string',
        'ElasticChannelConfiguration': {
            'MaximumSubChannels': 123,
            'TargetMembershipsPerSubChannel': 123,
            'MinimumMembershipPercentage': 123
        }
    }
}

Response Structure

  • (dict) --

    • Channel (dict) --

      The channel details.

      • Name (string) --

        The name of a channel.

      • ChannelArn (string) --

        The ARN of a channel.

      • Mode (string) --

        The mode of the channel.

      • Privacy (string) --

        The channel's privacy setting.

      • Metadata (string) --

        The channel's metadata.

      • CreatedBy (dict) --

        The AppInstanceUser who created the channel.

        • Arn (string) --

          The ARN in an Identity.

        • Name (string) --

          The name in an Identity.

      • CreatedTimestamp (datetime) --

        The time at which the AppInstanceUser created the channel.

      • LastMessageTimestamp (datetime) --

        The time at which a member sent the last message in the channel.

      • LastUpdatedTimestamp (datetime) --

        The time at which a channel was last updated.

      • ChannelFlowArn (string) --

        The ARN of the channel flow.

      • ElasticChannelConfiguration (dict) --

        The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of 1-million members.

        • MaximumSubChannels (integer) --

          The maximum number of SubChannels that you want to allow in the elastic channel.

        • TargetMembershipsPerSubChannel (integer) --

          The maximum number of members allowed in a SubChannel.

        • MinimumMembershipPercentage (integer) --

          The minimum allowed percentage of TargetMembershipsPerSubChannel users. Ceil of the calculated value is used in balancing members among SubChannels of the elastic channel.

DescribeChannelMembership (updated) Link ¶
Changes (request, response)
Request
{'SubChannelId': 'string'}
Response
{'ChannelMembership': {'SubChannelId': 'string'}}

Returns the full details of a user's channel membership.

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.describe_channel_membership(
    ChannelArn='string',
    MemberArn='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel.

type MemberArn

string

param MemberArn

[REQUIRED]

The AppInstanceUserArn of the member.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request. The response contains an ElasticChannelConfiguration object.

Note

Only required to get a user’s SubChannel membership details.

rtype

dict

returns

Response Syntax

{
    'ChannelMembership': {
        'InvitedBy': {
            'Arn': 'string',
            'Name': 'string'
        },
        'Type': 'DEFAULT'|'HIDDEN',
        'Member': {
            'Arn': 'string',
            'Name': 'string'
        },
        'ChannelArn': 'string',
        'CreatedTimestamp': datetime(2015, 1, 1),
        'LastUpdatedTimestamp': datetime(2015, 1, 1),
        'SubChannelId': 'string'
    }
}

Response Structure

  • (dict) --

    • ChannelMembership (dict) --

      The details of the membership.

      • InvitedBy (dict) --

        The identifier of the member who invited another member.

        • Arn (string) --

          The ARN in an Identity.

        • Name (string) --

          The name in an Identity.

      • Type (string) --

        The membership type set for the channel member.

      • Member (dict) --

        The data of the channel member.

        • Arn (string) --

          The ARN in an Identity.

        • Name (string) --

          The name in an Identity.

      • ChannelArn (string) --

        The ARN of the member's channel.

      • CreatedTimestamp (datetime) --

        The time at which the channel membership was created.

      • LastUpdatedTimestamp (datetime) --

        The time at which a channel membership was last updated.

      • SubChannelId (string) --

        The ID of the SubChannel that a user belongs to.

DescribeChannelMembershipForAppInstanceUser (updated) Link ¶
Changes (response)
{'ChannelMembership': {'AppInstanceUserMembershipSummary': {'SubChannelId': 'string'}}}

Returns the details of a channel based on the membership of the specified AppInstanceUser .

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.describe_channel_membership_for_app_instance_user(
    ChannelArn='string',
    AppInstanceUserArn='string',
    ChimeBearer='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel to which the user belongs.

type AppInstanceUserArn

string

param AppInstanceUserArn

[REQUIRED]

The ARN of the user in a channel.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

rtype

dict

returns

Response Syntax

{
    'ChannelMembership': {
        'ChannelSummary': {
            'Name': 'string',
            'ChannelArn': 'string',
            'Mode': 'UNRESTRICTED'|'RESTRICTED',
            'Privacy': 'PUBLIC'|'PRIVATE',
            'Metadata': 'string',
            'LastMessageTimestamp': datetime(2015, 1, 1)
        },
        'AppInstanceUserMembershipSummary': {
            'Type': 'DEFAULT'|'HIDDEN',
            'ReadMarkerTimestamp': datetime(2015, 1, 1),
            'SubChannelId': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • ChannelMembership (dict) --

      The channel to which a user belongs.

      • ChannelSummary (dict) --

        Returns the channel data for an AppInstance .

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

      • AppInstanceUserMembershipSummary (dict) --

        Returns the channel membership data for an AppInstance .

        • Type (string) --

          The type of ChannelMembership .

        • ReadMarkerTimestamp (datetime) --

          The time at which an AppInstanceUser last marked a channel as read.

        • SubChannelId (string) --

          The ID of the SubChannel that the AppInstanceUser is a member of.

GetChannelMessage (updated) Link ¶
Changes (request, response)
Request
{'SubChannelId': 'string'}
Response
{'ChannelMessage': {'SubChannelId': 'string'}}

Gets the full details of a channel message.

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.get_channel_message(
    ChannelArn='string',
    MessageId='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel.

type MessageId

string

param MessageId

[REQUIRED]

The ID of the message.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

Note

Only required when getting messages in a SubChannel that the user belongs to.

rtype

dict

returns

Response Syntax

{
    'ChannelMessage': {
        'ChannelArn': 'string',
        'MessageId': 'string',
        'Content': 'string',
        'Metadata': 'string',
        'Type': 'STANDARD'|'CONTROL',
        'CreatedTimestamp': datetime(2015, 1, 1),
        'LastEditedTimestamp': datetime(2015, 1, 1),
        'LastUpdatedTimestamp': datetime(2015, 1, 1),
        'Sender': {
            'Arn': 'string',
            'Name': 'string'
        },
        'Redacted': True|False,
        'Persistence': 'PERSISTENT'|'NON_PERSISTENT',
        'Status': {
            'Value': 'SENT'|'PENDING'|'FAILED'|'DENIED',
            'Detail': 'string'
        },
        'MessageAttributes': {
            'string': {
                'StringValues': [
                    'string',
                ]
            }
        },
        'SubChannelId': 'string'
    }
}

Response Structure

  • (dict) --

    • ChannelMessage (dict) --

      The details of and content in the message.

      • ChannelArn (string) --

        The ARN of the channel.

      • MessageId (string) --

        The ID of a message.

      • Content (string) --

        The message content.

      • Metadata (string) --

        The message metadata.

      • Type (string) --

        The message type.

      • CreatedTimestamp (datetime) --

        The time at which the message was created.

      • LastEditedTimestamp (datetime) --

        The time at which a message was edited.

      • LastUpdatedTimestamp (datetime) --

        The time at which a message was updated.

      • Sender (dict) --

        The message sender.

        • Arn (string) --

          The ARN in an Identity.

        • Name (string) --

          The name in an Identity.

      • Redacted (boolean) --

        Hides the content of a message.

      • Persistence (string) --

        The persistence setting for a channel message.

      • Status (dict) --

        The status of the channel message.

        • Value (string) --

          The message status value.

        • Detail (string) --

          Contains more details about the messasge status.

      • MessageAttributes (dict) --

        The attributes for the message, used for message filtering along with a FilterRule defined in the PushNotificationPreferences .

        • (string) --

          • (dict) --

            A list of message attribute values.

            • StringValues (list) --

              The strings in a message attribute value.

              • (string) --

      • SubChannelId (string) --

        The ID of the SubChannel.

GetChannelMessageStatus (updated) Link ¶
Changes (request)
{'SubChannelId': 'string'}

Gets message status for a specified messageId . Use this API to determine the intermediate status of messages going through channel flow processing. The API provides an alternative to retrieving message status if the event was not received because a client wasn't connected to a websocket.

Messages can have any one of these statuses.

SENT

Message processed successfully

PENDING

Ongoing processing

FAILED

Processing failed

DENIED

Messasge denied by the processor

Note

  • This API does not return statuses for denied messages, because we don't store them once the processor denies them.

  • Only the message sender can invoke this API.

  • 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.get_channel_message_status(
    ChannelArn='string',
    MessageId='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel

type MessageId

string

param MessageId

[REQUIRED]

The ID of the message.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user making the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

Note

Only required when getting message status in a SubChannel that the user belongs to.

rtype

dict

returns

Response Syntax

{
    'Status': {
        'Value': 'SENT'|'PENDING'|'FAILED'|'DENIED',
        'Detail': 'string'
    }
}

Response Structure

  • (dict) --

    • Status (dict) --

      The message status and details.

      • Value (string) --

        The message status value.

      • Detail (string) --

        Contains more details about the messasge status.

ListChannelMemberships (updated) Link ¶
Changes (request)
{'SubChannelId': 'string'}

Lists all channel memberships in a channel.

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.

If you want to list the channels to which a specific app instance user belongs, see the ListChannelMembershipsForAppInstanceUser API.

See also: AWS API Documentation

Request Syntax

client.list_channel_memberships(
    ChannelArn='string',
    Type='DEFAULT'|'HIDDEN',
    MaxResults=123,
    NextToken='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The maximum number of channel memberships that you want returned.

type Type

string

param Type

The membership type of a user, DEFAULT or HIDDEN . Default members are returned as part of ListChannelMemberships if no type is specified. Hidden members are only returned if the type filter in ListChannelMemberships equals HIDDEN .

type MaxResults

integer

param MaxResults

The maximum number of channel memberships that you want returned.

type NextToken

string

param NextToken

The token passed by previous API calls until all requested channel memberships are returned.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

Note

Only required when listing a user's memberships in a particular sub-channel of an elastic channel.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string',
    'ChannelMemberships': [
        {
            'Member': {
                'Arn': 'string',
                'Name': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel.

    • ChannelMemberships (list) --

      The information for the requested channel memberships.

      • (dict) --

        Summary of the details of a ChannelMembership .

        • Member (dict) --

          A member's summary data.

          • Arn (string) --

            The ARN in an Identity.

          • Name (string) --

            The name in an Identity.

    • NextToken (string) --

      The token passed by previous API calls until all requested channel memberships are returned.

ListChannelMembershipsForAppInstanceUser (updated) Link ¶
Changes (response)
{'ChannelMemberships': {'AppInstanceUserMembershipSummary': {'SubChannelId': 'string'}}}

Lists all channels that a particular AppInstanceUser is a part of. Only an AppInstanceAdmin can call the API with a user ARN that is not their own.

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.list_channel_memberships_for_app_instance_user(
    AppInstanceUserArn='string',
    MaxResults=123,
    NextToken='string',
    ChimeBearer='string'
)
type AppInstanceUserArn

string

param AppInstanceUserArn

The ARN of the AppInstanceUser s

type MaxResults

integer

param MaxResults

The maximum number of users that you want returned.

type NextToken

string

param NextToken

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

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

rtype

dict

returns

Response Syntax

{
    'ChannelMemberships': [
        {
            'ChannelSummary': {
                'Name': 'string',
                'ChannelArn': 'string',
                'Mode': 'UNRESTRICTED'|'RESTRICTED',
                'Privacy': 'PUBLIC'|'PRIVATE',
                'Metadata': 'string',
                'LastMessageTimestamp': datetime(2015, 1, 1)
            },
            'AppInstanceUserMembershipSummary': {
                'Type': 'DEFAULT'|'HIDDEN',
                'ReadMarkerTimestamp': datetime(2015, 1, 1),
                'SubChannelId': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ChannelMemberships (list) --

      The information for the requested channel memberships.

      • (dict) --

        Summary of the channel membership details of an AppInstanceUser .

        • ChannelSummary (dict) --

          Returns the channel data for an AppInstance .

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

        • AppInstanceUserMembershipSummary (dict) --

          Returns the channel membership data for an AppInstance .

          • Type (string) --

            The type of ChannelMembership .

          • ReadMarkerTimestamp (datetime) --

            The time at which an AppInstanceUser last marked a channel as read.

          • SubChannelId (string) --

            The ID of the SubChannel that the AppInstanceUser is a member of.

    • NextToken (string) --

      The token passed by previous API calls until all requested users are returned.

ListChannelMessages (updated) Link ¶
Changes (both)
{'SubChannelId': 'string'}

List all the messages in a channel. Returns a paginated list of ChannelMessages . By default, sorted by creation timestamp in descending order.

Note

Redacted messages appear in the results as empty, since they are only redacted, not deleted. Deleted messages do not appear in the results. This action always returns the latest version of an edited message.

Also, 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.list_channel_messages(
    ChannelArn='string',
    SortOrder='ASCENDING'|'DESCENDING',
    NotBefore=datetime(2015, 1, 1),
    NotAfter=datetime(2015, 1, 1),
    MaxResults=123,
    NextToken='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel.

type SortOrder

string

param SortOrder

The order in which you want messages sorted. Default is Descending, based on time created.

type NotBefore

datetime

param NotBefore

The initial or starting time stamp for your requested messages.

type NotAfter

datetime

param NotAfter

The final or ending time stamp for your requested messages.

type MaxResults

integer

param MaxResults

The maximum number of messages that you want returned.

type NextToken

string

param NextToken

The token passed by previous API calls until all requested messages are returned.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

Note

Only required when listing the messages in a SubChannel that the user belongs to.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string',
    'NextToken': 'string',
    'ChannelMessages': [
        {
            'MessageId': 'string',
            'Content': 'string',
            'Metadata': 'string',
            'Type': 'STANDARD'|'CONTROL',
            'CreatedTimestamp': datetime(2015, 1, 1),
            'LastUpdatedTimestamp': datetime(2015, 1, 1),
            'LastEditedTimestamp': datetime(2015, 1, 1),
            'Sender': {
                'Arn': 'string',
                'Name': 'string'
            },
            'Redacted': True|False,
            'Status': {
                'Value': 'SENT'|'PENDING'|'FAILED'|'DENIED',
                'Detail': 'string'
            },
            'MessageAttributes': {
                'string': {
                    'StringValues': [
                        'string',
                    ]
                }
            }
        },
    ],
    'SubChannelId': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel containing the requested messages.

    • NextToken (string) --

      The token passed by previous API calls until all requested messages are returned.

    • ChannelMessages (list) --

      The information about, and content of, each requested message.

      • (dict) --

        Summary of the messages in a Channel .

        • MessageId (string) --

          The ID of the message.

        • Content (string) --

          The content of the message.

        • Metadata (string) --

          The metadata of the message.

        • Type (string) --

          The type of message.

        • CreatedTimestamp (datetime) --

          The time at which the message summary was created.

        • LastUpdatedTimestamp (datetime) --

          The time at which a message was last updated.

        • LastEditedTimestamp (datetime) --

          The time at which a message was last edited.

        • Sender (dict) --

          The message sender.

          • Arn (string) --

            The ARN in an Identity.

          • Name (string) --

            The name in an Identity.

        • Redacted (boolean) --

          Indicates whether a message was redacted.

        • Status (dict) --

          The message status. The status value is SENT for messages sent to a channel without a channel flow. For channels associated with channel flow, the value determines the processing stage.

          • Value (string) --

            The message status value.

          • Detail (string) --

            Contains more details about the messasge status.

        • MessageAttributes (dict) --

          The message attribues listed in a the summary of a channel message.

          • (string) --

            • (dict) --

              A list of message attribute values.

              • StringValues (list) --

                The strings in a message attribute value.

                • (string) --

    • SubChannelId (string) --

      The ID of the SubChannel in the response.

RedactChannelMessage (updated) Link ¶
Changes (both)
{'SubChannelId': 'string'}

Redacts message content, but not metadata. The message exists in the back end, but the action returns null content, and the state shows as redacted.

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.redact_channel_message(
    ChannelArn='string',
    MessageId='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel containing the messages that you want to redact.

type MessageId

string

param MessageId

[REQUIRED]

The ID of the message being redacted.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string',
    'MessageId': 'string',
    'SubChannelId': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel containing the messages that you want to redact.

    • MessageId (string) --

      The ID of the message being redacted.

    • SubChannelId (string) --

      The ID of the SubChannel in the response.

      Note

      Only required when redacting messages in a SubChannel that the user belongs to.

SendChannelMessage (updated) Link ¶
Changes (both)
{'SubChannelId': 'string'}

Sends a message to a particular channel that the member is a part of.

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.

Also, STANDARD messages can contain 4KB of data and the 1KB of metadata. CONTROL messages can contain 30 bytes of data and no metadata.

See also: AWS API Documentation

Request Syntax

client.send_channel_message(
    ChannelArn='string',
    Content='string',
    Type='STANDARD'|'CONTROL',
    Persistence='PERSISTENT'|'NON_PERSISTENT',
    Metadata='string',
    ClientRequestToken='string',
    ChimeBearer='string',
    PushNotification={
        'Title': 'string',
        'Body': 'string',
        'Type': 'DEFAULT'|'VOIP'
    },
    MessageAttributes={
        'string': {
            'StringValues': [
                'string',
            ]
        }
    },
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel.

type Content

string

param Content

[REQUIRED]

The content of the message.

type Type

string

param Type

[REQUIRED]

The type of message, STANDARD or CONTROL .

type Persistence

string

param Persistence

[REQUIRED]

Boolean that controls whether the message is persisted on the back end. Required.

type Metadata

string

param Metadata

The optional metadata for each message.

type ClientRequestToken

string

param ClientRequestToken

[REQUIRED]

The Idempotency token for each client request.

This field is autopopulated if not provided.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type PushNotification

dict

param PushNotification

The push notification configuration of the message.

  • Title (string) --

    The title of the push notification.

  • Body (string) --

    The body of the push notification.

  • Type (string) --

    Enum value that indicates the type of the push notification for a message. DEFAULT : Normal mobile push notification. VOIP : VOIP mobile push notification.

type MessageAttributes

dict

param MessageAttributes

The attributes for the message, used for message filtering along with a FilterRule defined in the PushNotificationPreferences .

  • (string) --

    • (dict) --

      A list of message attribute values.

      • StringValues (list) --

        The strings in a message attribute value.

        • (string) --

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string',
    'MessageId': 'string',
    'Status': {
        'Value': 'SENT'|'PENDING'|'FAILED'|'DENIED',
        'Detail': 'string'
    },
    'SubChannelId': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel.

    • MessageId (string) --

      The ID string assigned to each message.

    • Status (dict) --

      The status of the channel message.

      • Value (string) --

        The message status value.

      • Detail (string) --

        Contains more details about the messasge status.

    • SubChannelId (string) --

      The ID of the SubChannel in the response.

UpdateChannelMessage (updated) Link ¶
Changes (both)
{'SubChannelId': 'string'}

Updates the content of a message.

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.update_channel_message(
    ChannelArn='string',
    MessageId='string',
    Content='string',
    Metadata='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel.

type MessageId

string

param MessageId

[REQUIRED]

The ID string of the message being updated.

type Content

string

param Content

The content of the message being updated.

type Metadata

string

param Metadata

The metadata of the message being updated.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

Note

Only required when updating messages in a SubChannel that the user belongs to.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string',
    'MessageId': 'string',
    'Status': {
        'Value': 'SENT'|'PENDING'|'FAILED'|'DENIED',
        'Detail': 'string'
    },
    'SubChannelId': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel.

    • MessageId (string) --

      The ID string of the message being updated.

    • Status (dict) --

      The status of the message update.

      • Value (string) --

        The message status value.

      • Detail (string) --

        Contains more details about the messasge status.

    • SubChannelId (string) --

      The ID of the SubChannel in the response.

UpdateChannelReadMarker (updated) Link ¶
Changes (both)
{'SubChannelId': 'string'}

The details of the time when a user last read messages in a channel.

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.update_channel_read_marker(
    ChannelArn='string',
    ChimeBearer='string',
    SubChannelId='string'
)
type ChannelArn

string

param ChannelArn

[REQUIRED]

The ARN of the channel.

type ChimeBearer

string

param ChimeBearer

[REQUIRED]

The AppInstanceUserArn of the user that makes the API call.

type SubChannelId

string

param SubChannelId

The ID of the SubChannel in the request.

rtype

dict

returns

Response Syntax

{
    'ChannelArn': 'string',
    'SubChannelId': 'string'
}

Response Structure

  • (dict) --

    • ChannelArn (string) --

      The ARN of the channel.

    • SubChannelId (string) --

      The ID of the SubChannel in the response.