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, auth_session: symphony.bdk.core.auth.auth_session.AuthSession, retry_config: symphony.bdk.core.config.model.bdk_retry_config.BdkRetryConfig)#

Bases: object

Class 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, 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.

get_attachment_types()

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.

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 Message instance or a string containing the MessageML content to be sent. If it is a Message instance, 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 Message instance or a string containing the MessageML content to be sent. If it is a Message instance, 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.