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:
| Property | Description |
|---|---|
| _id | ID of the message |
| senderParticipantSessionId | Participant Session ID of the sender |
| senderName | Display name of the sender |
| recipientParticipantSessionId | Present only on a directed (private) message: the Participant Session ID the message was sent to |
| type | Type of the message, one of "text", "file" or "image" |
| content | The message text (for text messages) or the file name (for file / image messages) |
| fileName | Name of the file. Present on file / image messages |
| fileMimeType | MIME type of the file. Present on file / image messages |
| fileSizeBytes | Size of the file in bytes. Present on file / image messages |
| downloadToken | Present on file / image messages. Use it to download the file (see below) |
| created | ISO timestamp of when the message was created |
| meetingSessionId | ID 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.