send_channel_message
(**kwargs)¶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
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'
)
[REQUIRED]
The ARN of the channel.
[REQUIRED]
The content of the message.
[REQUIRED]
The type of message, STANDARD
or CONTROL
.
[REQUIRED]
Boolean that controls whether the message is persisted on the back end. Required.
[REQUIRED]
The Idempotency
token for each client request.
This field is autopopulated if not provided.
[REQUIRED]
The AppInstanceUserArn
of the user that makes the API call.
The push notification configuration of the message.
The title of the push notification.
The body of the push notification.
Enum value that indicates the type of the push notification for a message. DEFAULT
: Normal mobile push notification. VOIP
: VOIP mobile push notification.
The attributes for the message, used for message filtering along with a FilterRule
defined in the PushNotificationPreferences
.
A list of message attribute values.
The strings in a message attribute value.
dict
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.BadRequestException
ChimeSDKMessaging.Client.exceptions.ConflictException
ChimeSDKMessaging.Client.exceptions.ForbiddenException
ChimeSDKMessaging.Client.exceptions.UnauthorizedClientException
ChimeSDKMessaging.Client.exceptions.ThrottledClientException
ChimeSDKMessaging.Client.exceptions.ServiceUnavailableException
ChimeSDKMessaging.Client.exceptions.ServiceFailureException