symphony.bdk.core.service.message.message_service.OboMessageService#
- class symphony.bdk.core.service.message.message_service.OboMessageService(messages_api: symphony.bdk.core.service.message.multi_attachments_messages_api.MultiAttachmentsMessagesApi, message_suppression_api: symphony.bdk.gen.pod_api.message_suppression_api.MessageSuppressionApi, pod_api: symphony.bdk.gen.pod_api.pod_api.PodApi, auth_session: symphony.bdk.core.auth.auth_session.AuthSession, retry_config: symphony.bdk.core.config.model.bdk_retry_config.BdkRetryConfig)#
Bases:
objectClass exposing OBO enabled endpoints for message management, e.g. send a message.
- __init__(messages_api: symphony.bdk.core.service.message.multi_attachments_messages_api.MultiAttachmentsMessagesApi, message_suppression_api: symphony.bdk.gen.pod_api.message_suppression_api.MessageSuppressionApi, pod_api: symphony.bdk.gen.pod_api.pod_api.PodApi, auth_session: symphony.bdk.core.auth.auth_session.AuthSession, retry_config: symphony.bdk.core.config.model.bdk_retry_config.BdkRetryConfig)#
Methods
__init__(messages_api, ...)blast_message(stream_ids, message[, data, ...])Send a message to multiple existing streams.
Retrieves a list of supported file extensions for attachments.
send_message(stream_id, message[, data, ...])Send a message to an existing stream.
suppress_message(message_id)Suppresses a message, preventing its contents from being displayed to users.
update_message(stream_id, message_id, message)Update an existing message.
- async blast_message(stream_ids: List[str], message: Union[str, symphony.bdk.core.service.message.model.Message], data=None, version: str = '', attachment: Optional[List[Union[IO, Tuple[IO, IO]]]] = None) symphony.bdk.gen.agent_model.v4_message_blast_response.V4MessageBlastResponse#
Send a message to multiple existing streams. See: Blast Message
- Parameters
stream_ids – The list of stream IDs to send the message to
message – a
Messageinstance or a string containing the MessageML content to be sent. If it is aMessageinstance, other parameters will be ignored. If it is a string,<messageML>tags can be omitted.data – an object (e.g. dict) that will be serialized into JSON using
json.dumps.version – Optional message version in the format “major.minor”. If empty, defaults to the latest supported version.
attachment – One or more files (opened in binary or text mode) to be sent along with the message. Elements of the list can be attachment files or tuples of
(attachment, preview). If one attachment has a preview, then all attachments must have a preview. The limit is set to 30Mb total size; also, it is recommended not to exceed 25 files.
- Returns
- get_attachment_types() List[str]#
Retrieves a list of supported file extensions for attachments. See: Attachment Types
- Returns
a list of String containing all allowed file extensions for attachments.
- async send_message(stream_id: str, message: Union[str, symphony.bdk.core.service.message.model.Message], data=None, version: str = '', attachment: Optional[List[Union[IO, Tuple[IO, IO]]]] = None) symphony.bdk.gen.agent_model.v4_message.V4Message#
Send a message to an existing stream. See: Create Message
- Parameters
stream_id – The ID of the stream to send the message to.
message – a
Messageinstance or a string containing the MessageML content to be sent. If it is aMessageinstance, other parameters will be ignored. If it is a string,<messageML>tags can be omitted.data – an object (e.g. dict) that will be serialized into JSON using
json.dumps.version – Optional message version in the format “major.minor”. If empty, defaults to the latest supported version.
attachment – One or more files (opened in binary or text mode) to be sent along with the message. Elements of the list can be attachment files or tuples of
(attachment, preview). If one attachment has a preview, then all attachments must have a preview. The limit is set to 30Mb total size; also, it is recommended not to exceed 25 files.
- Returns
a V4Message object containing the details of the sent message.
- suppress_message(message_id: str) symphony.bdk.gen.pod_model.message_suppression_response.MessageSuppressionResponse#
Suppresses a message, preventing its contents from being displayed to users. See: Suppress Message
- Parameters
message_id – Message ID of the message to be suppressed.
- Returns
a MessageSuppressionResponse instance containing information about the message suppression.
- update_message(stream_id: str, message_id: str, message: Union[str, symphony.bdk.core.service.message.model.Message], data=None, version: str = '', silent=True) symphony.bdk.gen.agent_model.v4_message.V4Message#
Update an existing message. The existing message must be a valid social message, that has not been deleted. See: Update Message
- Parameters
stream_id – The ID of the stream where the message is being updated.
message_id – The ID of the message that is being updated.
message – a
Messageinstance or a string containing the MessageML content to be sent. If it is aMessageinstance, other parameters will be ignored. If it is a string,<messageML>tags can be omitted.data – an object (e.g. dict) that will be serialized into JSON using
json.dumps.silent – a bool flag that will determine if the updated message is going to be marked as read (when true, which is default value) or unread (when false).
version – Optional message version in the format “major.minor”. If empty, defaults to the latest supported version.
- Returns
a V4Message object containing the details of the updated message.