send_channel_message
¶
send_channel_message(
channel_arn: ChimeArn,
content: NonEmptyContent,
type: ChannelMessageType,
persistence: ChannelMessagePersistenceType,
client_request_token: ClientRequestToken,
chime_bearer: ChimeArn,
*,
config_overrides: Optional[ChimeSDKMessagingClientConfig] = 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/chime_sdk_messaging.py
3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 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 | |