send_channel_message
async
¶
send_channel_message(
channel_arn: ChimeArn,
content: NonEmptyContent,
type: ChannelMessageType,
persistence: ChannelMessagePersistenceType,
client_request_token: ClientRequestToken,
chime_bearer: ChimeArn,
*,
config_overrides: Optional[AsyncChimeSDKMessagingClientConfig] = None,
metadata: Optional[Metadata] = None,
push_notification: Optional[PushNotificationConfiguration] = None,
message_attributes: Optional[MessageAttributeMap] = None,
sub_channel_id: Optional[SubChannelId] = None,
content_type: Optional[ContentType] = None,
target: Optional[TargetList] = None,
) -> SendChannelMessageResponse
Sends a message to a particular channel that the member is a part of.
The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
Also, STANDARD messages can be up to 4KB in size and contain metadata. Metadata is arbitrary, and you can use it in a variety of ways, such as containing a link to an attachment.
CONTROL messages are limited to 30 bytes and do not contain metadata.
Parameters:
-
channel_arn(ChimeArn) –The ARN of the channel.
-
content(NonEmptyContent) –The content of the channel message.
-
type(ChannelMessageType) –The type of message,
STANDARDorCONTROL.STANDARDmessages can be up to 4KB in size and contain metadata. Metadata is arbitrary, and you can use it in a variety of ways, such as containing a link to an attachment.CONTROLmessages are limited to 30 bytes and do not contain metadata. -
persistence(ChannelMessagePersistenceType) –Boolean that controls whether the message is persisted on the back end. Required.
-
metadata(Optional[Metadata], default:None) –The optional metadata for each message.
-
client_request_token(ClientRequestToken) –The
Idempotencytoken for each client request. -
chime_bearer(ChimeArn) –The ARN of the
AppInstanceUserorAppInstanceBotthat makes the API call. -
push_notification(Optional[PushNotificationConfiguration], default:None) –The push notification configuration of the message.
-
message_attributes(Optional[MessageAttributeMap], default:None) –The attributes for the message, used for message filtering along with a
FilterRuledefined in thePushNotificationPreferences. -
sub_channel_id(Optional[SubChannelId], default:None) –The ID of the SubChannel in the request.
-
content_type(Optional[ContentType], default:None) –The content type of the channel message.
-
target(Optional[TargetList], default:None) –The target of a message. Must be a member of the channel, such as another user, a bot, or the sender. Only the target and the sender can view targeted messages. Only users who can see targeted messages can take actions on them. However, administrators can delete targeted messages that they can’t see.
Raises:
-
BadRequestException–The input parameters don't match the service's restrictions.
-
ConflictException–The request could not be processed because of conflict in the current state of the resource.
-
ForbiddenException–The client is permanently forbidden from making the request.
-
ServiceFailureException–The service encountered an unexpected error.
-
ServiceUnavailableException–The service is currently unavailable.
-
ThrottledClientException–The client exceeded its request rate limit.
-
UnauthorizedClientException–The client is not currently authorized to make the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_chime_sdk_messaging/_services/async_chime_sdk_messaging.py
3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 | |