ChimeSDKMessaging.Client.create_channel_membership(**kwargs)¶Adds a user to a channel. The InvitedBy field in ChannelMembership is derived from the request header. A channel member can:
Privacy settings impact this action as follows:
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
response = client.create_channel_membership(
ChannelArn='string',
MemberArn='string',
Type='DEFAULT'|'HIDDEN',
ChimeBearer='string',
SubChannelId='string'
)
[REQUIRED]
The ARN of the channel to which you're adding users.
[REQUIRED]
The AppInstanceUserArn of the member you want to add to the channel.
[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.
[REQUIRED]
The AppInstanceUserArn of the user that makes the API call.
The ID of the SubChannel in the request.
Note
Only required when creating membership in a SubChannel for a moderator in an elastic channel.
dict
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.
Exceptions
ChimeSDKMessaging.Client.exceptions.BadRequestExceptionChimeSDKMessaging.Client.exceptions.NotFoundExceptionChimeSDKMessaging.Client.exceptions.ForbiddenExceptionChimeSDKMessaging.Client.exceptions.UnauthorizedClientExceptionChimeSDKMessaging.Client.exceptions.ConflictExceptionChimeSDKMessaging.Client.exceptions.ResourceLimitExceededExceptionChimeSDKMessaging.Client.exceptions.ThrottledClientExceptionChimeSDKMessaging.Client.exceptions.ServiceUnavailableExceptionChimeSDKMessaging.Client.exceptions.ServiceFailureException