Pin a message

The pinMessage function exposed by the SDK allows you to pin at the top of a chat a message, specified by its messageId.

If another message is already pinned, it is replaced.

Currently it is not possible to programmatically unpin a message.

The user needs to be owner of the room to be able to pin the message, otherwise an error will be returned.

Parameters

Parameter
Type
Description

messageId

string

Id of the message to be pinned.

Returned promise

The Pin message function returns a JavaScript Promise that will resolve once the action has been completed. The promise has the following interface:

Promise<true | SdkError>;

Success

- In case of success, the promise returns true.

Error

- In case of error, the promise returns a SdkError structure, with the following properties:

Parameter
Type
Description

type

string

Type of error: ERROR for generic errors; MESSAGE_ID_NOT_FOUND if the message Id is not valid

message

string

Description of the error.

data

Object

Additional data on the error, with the message Id that was specified for the pin method.

Example

const result = await window.symphony.sdk.pinMessage('ORRT7G00Bm0skftV+kK2tX///nZz1Vs4bQ==');

Last updated