Message Preview

Messages preview is partial data of the message that offers a brief summary of incoming messages through channel and subchannel objects. It allows users to quickly assess partial message content without opening the entire message.

To enable this feature, please refer to the API and the sample cURL commands provided below:

API: Enable message preview

curl --location --request PUT 'https://apix.sg.amity.co/api/v3/network-settings/chat' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxx' \
--data '{
  "isAllowMentionedChannelEnabled": false,
  "messagePreviewSetting": {
    "enabled": true,
    "isIncludeDeleted": false
  },
  "isAllowAdminViewConversationMessage": true,
  "isAllowAdminManageConversationMessage": true
}'

Note: Message Preview will be available only in channels and subchannels for new messages created after the feature is enabled.

Message Previews in Applications

Message previews play a crucial role in enhancing user experience in messaging platforms. By offering a brief glimpse of incoming messages through channel and subchannel objects, users can assess the urgency, context, and relevance of messages without needing to open the entire conversation. This feature is particularly beneficial in various scenarios:

  1. Notifications: When a user receives a push notification or a message alert, a message preview can be shown, allowing the user to decide whether to engage immediately or defer it to a later time.

  2. Chat List: In a list of ongoing conversations, each chat item can display the latest message as a preview. This helps users quickly identify and prioritize which chat to respond to first.

  3. Data Economy: In scenarios where users have limited bandwidth or are on metered connections, previews allow them to decide if they want to download or load the complete message or any associated media.

Integrating message previews into applications can significantly boost user engagement and satisfaction. By offering users an efficient way to manage their interactions, apps can optimize response times and streamline communication workflows.

Message Preview attributes

NameData TypeDescriptionAttributes

messageId

string

The id of this message

​Content

channelId

string

The name of the channel this message was created in

​Content

userId

string

The name of the user this message was created by

​Content

type

string

The message type

enum*: text custom image file

data

Object

The message data (any text will be stored in text key)

text: Text message

isDeleted

boolean

The message has been marked as deleted

​Content

createdAt

date

The date/time the message was created at

​Content

updatedAt

date

The date/time the message was updated at

​Content

Channel message preview

Within our SDK, clients can effortlessly obtain message previews using a channel object attribute.

Subchannel message preview

Our SDK offers clients a straightforward approach to access message previews for subchannels through dedicated subchannel object attributes.

Last updated