Chime / Client / create_channel_membership

create_channel_membership#

Chime.Client.create_channel_membership(**kwargs)#

Adds a user to a channel. The InvitedBy response field 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.

Warning

This API is is no longer supported and will not be updated. We recommend using the latest version, CreateChannelMembership, in the Amazon Chime SDK.

Using the latest version requires migrating to a dedicated namespace. For more information, refer to Migrating from the Amazon Chime namespace in the Amazon Chime SDK Developer Guide.

Danger

This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.

See also: AWS API Documentation

Request Syntax

response = client.create_channel_membership(
    ChannelArn='string',
    MemberArn='string',
    Type='DEFAULT'|'HIDDEN',
    ChimeBearer='string'
)
Parameters:
  • ChannelArn (string) –

    [REQUIRED]

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

  • MemberArn (string) –

    [REQUIRED]

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

  • Type (string) –

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

  • ChimeBearer (string) – The AppInstanceUserArn of the user that makes the API call.

Return type:

dict

Returns:

Response Syntax

{
    'ChannelArn': 'string',
    'Member': {
        'Arn': 'string',
        'Name': '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.

Exceptions