ChimeSDKMessaging / Client / send_channel_message
send_channel_message#
- ChimeSDKMessaging.Client.send_channel_message(**kwargs)#
Sends a message to a particular channel that the member is a part of.
Note
The
x-amz-chime-bearerrequest header is mandatory. Use the ARN of theAppInstanceUserorAppInstanceBotthat makes the API call as the value in the header.Also,
STANDARDmessages can contain 4KB of data and the 1KB of metadata.CONTROLmessages can contain 30 bytes of data and no metadata.See also: AWS API Documentation
Request Syntax
response = 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', ContentType='string' )
- Parameters:
ChannelArn (string) –
[REQUIRED]
The ARN of the channel.
Content (string) –
[REQUIRED]
The content of the message.
Type (string) –
[REQUIRED]
The type of message,
STANDARDorCONTROL.Persistence (string) –
[REQUIRED]
Boolean that controls whether the message is persisted on the back end. Required.
Metadata (string) – The optional metadata for each message.
ClientRequestToken (string) –
[REQUIRED]
The
Idempotencytoken for each client request.This field is autopopulated if not provided.
ChimeBearer (string) –
[REQUIRED]
The ARN of the
AppInstanceUserorAppInstanceBotthat makes the API call.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
FilterRuledefined in thePushNotificationPreferences.(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 request.
ContentType (string) – The content type of the channel message.
- Return type:
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.
Exceptions
ChimeSDKMessaging.Client.exceptions.BadRequestExceptionChimeSDKMessaging.Client.exceptions.ConflictExceptionChimeSDKMessaging.Client.exceptions.ForbiddenExceptionChimeSDKMessaging.Client.exceptions.UnauthorizedClientExceptionChimeSDKMessaging.Client.exceptions.ThrottledClientExceptionChimeSDKMessaging.Client.exceptions.ServiceUnavailableExceptionChimeSDKMessaging.Client.exceptions.ServiceFailureException