Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Home
/
Chat
/
JavaScript
/
Message
This is the new Docs for Chat SDK v4 for JavaScript. To see the previous Docs, click here.

Retrieve a message

You can retrieve a specific message in an open or group channel by creating and passing the MessageRetrievalParams object to the getMessage() method as a parameter.

Open channelGroup channel
const params: MessageRetrievalParams = {
    messageId: MESSAGE_ID,
    channelType: CHANNEL_TYPE,
    channelUrl: CHANNEL_URL,
};
// ...
const message = await sb.message.getMessage(params);

List of parameters

Parameter nameTypeDescription

messageId

long

Specifies the unique ID of the message.

channelType

string

Specifies the type of the channel.

channelUrl

string

Specifies the URL of the channel.