Skip to main content
Version: 2.1

SendChatMessage

Send a message to an existing chat room.

Intent Name

SendChatMessage

Display Name

Send Chat Message

Possible Contexts

Example

// Start a chat and retrieve a reference to the chat room created
const intentResolution = await fdc3.raiseIntent("StartChat", context);
const chatRoom = intentResolution.getResult();

//Some time later

let chatMessage: ChatMessage = {
type: "fdc3.chat.message",
chatRoom,
message: {
type: 'fdc3.message',
text: {
'text/plain': 'Hey all, can we discuss the issue together? I attached a screenshot'
},
entities: {
'0': {
type: 'fdc3.fileAttachment',
data: {
name: 'myImage.png',
dataUri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII'
}
}
}
}
}

await fdc3.raiseIntent("SendChatMessage", context, intentResolution.source);

See Also

Context

Intents