Send Messages
Send and receive messages with custom metadata and file attachments using ALO's JavaScript SDK.
Send a message
You can send a message as a reply, with custom metadata, and even pass a list of File
objects all in one command.
sendMessage({ channelId: string, content: string, ... })
sendMessage({ channelId: string, content: string, ... })
Name
Type
Required
Description
channelId
string
yes
The id of the channel that the message will be added to. ThechannelId
must be included in the list of channelIds
that were passed when generating the authToken
.
content
string
yes
The content of the message.
metadata
plain object
no
The metadata of the message is a custom object allowing you to attach any information you need directly onto the message.
parentId
string
no
If the message is a reply to another message, set the parentId
to the id
of the parent message.
files
array [File]
no
An array of File
objects that will be automatically uploaded to ALO's media servers and metadata persisted on the message
Receive new messages
subscribe({ channelIds: [string] })
subscribe({ channelIds: [string] })
Name
Type
Required
Description
channelIds
array [string]
yes
An array of channelIds
that specify which channels you want the client to receive events for through the function passed to addEventListener
.
Last updated