Skip to main content

chatMessageReceived

Emitted when a chat message arrives

This event is emitted when a chat message is received, whether it is a broadcast message sent to everyone or a private (directed) message where you are the sender or the recipient.

JavaScript
meeting.on("chatMessageReceived", function(message) {

});

Properties

message is an object that contains the following properties:

PropertyDescription
_idID of the message
senderParticipantSessionIdParticipant Session ID of the sender
senderNameDisplay name of the sender
recipientParticipantSessionIdPresent only on a directed (private) message: the Participant Session ID the message was sent to
typeType of the message, one of "text", "file" or "image"
contentThe message text (for text messages) or the file name (for file / image messages)
fileNameName of the file. Present on file / image messages
fileMimeTypeMIME type of the file. Present on file / image messages
fileSizeBytesSize of the file in bytes. Present on file / image messages
downloadTokenPresent on file / image messages. Use it to download the file (see below)
createdISO timestamp of when the message was created
meetingSessionIdID of the meeting session. Present only on broadcast messages, not on directed (private) ones

For file and image messages, download the file with the _id and downloadToken:

GET /api/v1/chat/file/<_id>?dl=<downloadToken>

See the Chat file sharing REST API for more details.