MessageClient

interface MessageClient

MessageClient represents a client to the Webex Teams platform. It can send and receive messages. Use Webex.messages to get an instance of MessageClient.

Since

0.1

Types

Link copied to clipboard
fun interface ProgressHandler

A callback to indicate the progress of an action in already processed size (bytes).

Functions

Link copied to clipboard
abstract fun delete(messageId: String, handler: CompletionHandler<Void>)

Deletes message pertaining to the given message id

Link copied to clipboard
abstract fun downloadFile(remoteFile: RemoteFile, path: File?, progressHandler: MessageClient.ProgressHandler?, completionHandler: CompletionHandler<Uri>)

Downloads a file attachement asynchronously. See File Sharing for more details.

Link copied to clipboard
abstract fun downloadThumbnail(remoteFile: RemoteFile, path: File?, completionHandler: CompletionHandler<Uri>)

Downloads the thumbnail (preview image) of a file attachment asynchronously. Note Cisco Webex doesn't generate thumbnail for all files. See File Sharing for more details.

Link copied to clipboard
abstract fun edit(originalMessage: Message, text: Message.Text?, mentions: ArrayList<Mention>?, handler: CompletionHandler<Message>)

Edit a previous sent message asynchronously.

Link copied to clipboard
abstract fun get(messageId: String, handler: CompletionHandler<Message>)

Retrieves a message asynchronously by message Id.

Link copied to clipboard
abstract fun list(spaceId: String, before: Before?, max: Int, mentions: ArrayList<Mention>?, handler: CompletionHandler<List<Message>>)

Lists all messages in a space by space Id asynchronously. If present, it includes the associated file attachment for each message.

Link copied to clipboard
abstract fun markAsRead(spaceId: String, messageId: String? = null, handler: CompletionHandler<Void>? = null)

Mark messages sent before the specified message in the space as read, including the specified message.

Link copied to clipboard
abstract fun post(target: String, draft: Message.Draft, handler: CompletionHandler<Message>)

Posts a message to a space or a person asynchronously.

Link copied to clipboard
abstract fun postToPerson(email: EmailAddress, text: Message.Text?, files: ArrayList<LocalFile>?, handler: CompletionHandler<Message>)
abstract fun postToPerson(id: String, text: Message.Text?, files: ArrayList<LocalFile>?, handler: CompletionHandler<Message>)

Posts a message with optional file attachments to a person asynchronously. The content of the message can be plain text, html, or markdown.

Link copied to clipboard
abstract fun postToSpace(id: String, text: Message.Text?, mentions: ArrayList<Mention>?, files: ArrayList<LocalFile>?, handler: CompletionHandler<Message>)

Posts a message with optional file attachments to a space asynchronously. The content of the message can be plain text, html, or markdown.

Link copied to clipboard
abstract fun setMessageObserver(observer: MessageObserver?)

Sets a MessageObserver in this client.