With the Message API, you can build messaging functionalities ranging from the essential to the advanced, including features such as message threading, delivery receipts, and emoji reactions.
Message types
There are three types of messages in Sendbird Chat:
Text message: A text message sent by a user in a channel.
File message: A file message sent by a user in a channel.
Admin message: A message sent only by an admin through the Chat API or the Sendbird Dashboard.
The mentioning method that indicates who gets a notification of the message. The value of users indicates that only users specified in the mentioned_users property get notified, while the value of channel indicates that all users in the channel get notified.
mentioned_users[]
array of objects
An array of the specific users who get a notification of a message.
is_removed
boolean
Indicates whether the message is removed from the channel.
message
string
The content of the message.
translations
object
The messages translated from the original language into one or more specified languages.
data
string
The string data which can contain additional message information such as custom font size, font type, or JSON formatted string.
sorted_metaarray
array of objects
An array of one or more JSON objects consisting of key-values items to store additional message information. When retrieving, items are returned in the exact order they've been initially added.
og_tag
nested object
The Open Graph (OG) metadata contained in the given URL when a text message or an admin message includes the URL of a web page. This consists of properties such as og:url, og:title, og:description, and og:image.
The file contained in the message. This property is empty for any text messages.
is_apple_critical_alert
boolean
Indicates whether the message is a critical alert.
thread_info
nested object
The thread information consisting of the reply count, most_replies, last_replied_at, and updated_at properties. The thread_info property is only retrieved if the message is a parent message.
thread_info.reply_count
long
The total number of replies in the thread. The value of 0 indicates that there is no reply.
thread_info.most_replies
array of objects
An array of one or more JSON objects containing the information of one or more users who replied the most. Up to five objects can be returned.
thread_info.last_replied_at
long
The time when the last reply was added in Unix milliseconds format. The value of 0 indicates that there is no reply.
thread_info.updated_at
long
The time when the thread information was updated due to a deleted or newly added reply in the thread, in Unix milliseconds format.
parent_message_id
long
The unique ID of a thread's parent message. This property is only retrieved if the message is a reply.
parent_message_info
nested object
The information of the thread's parent message including the text, user information, and message type. This property is only retrieved if the message is a reply.
is_reply_to_channel
boolean
Indicates whether the message was sent as a reply to the channel.
root_message_id
long
(Deprecated)Reserved value. This must be the same as parent_message_id.
parent_message_text
string
(Deprecated)The text of a thread's parent message. If the include_parent_message_text parameter is set to true, the value of this property is retrieved in the response.
List of properties for a file message
Property name
Type
Description
message_id
long
The unique ID of the message.
type
string
The type of the message. The value is FILE for a file message.
custom_type
string
The custom message type used for message grouping. The length is limited to 128 characters.
* Custom types are also used to segment metrics within Sendbird's Advanced analytics, which enables the sub-classification of data views.
channel_url
string
The unique URL of the channel where the message is sent to.
The mentioning method that indicates who gets a notification of the message. The value of users indicates that only users specified in the mentioned_users property get notified, while the value of channel indicates that all users in the channel get notified.
mentioned_users[]
array of objects
An array of the specific users who get a notification of the message.
is_removed
boolean
Indicates whether the message is removed from the channel.
file
nested object
The information on the file in the message, which was either directly updated to Sendbird server or specified by an externally hosted URL.
The string data which can contain additional message information such as custom font size, font type, or JSON formatted string.
sorted_metaarray
array of objects
An array of one or more JSON objects consisting of key-values items to store additional message information. When retrieving, items are returned in the exact order they've been initially added.
thumbnails[]
array of objects
An array of thumbnail images that were either automatically generated by Sendbird server from the uploaded image or video file in the message or specified by externally hosted URLs.
require_auth
boolean
Indicates whether the files and thumbnail images in a message are only accessible by users who are in the same channel. This property is only effective when using the share encrypted files feature. This feature encrypts any type of uploaded files and the automatically-generated thumbnail images with AES256, stores them securely in the Sendbird server, and only allows the users with access to share files. You can use this property to restrict access to the files.
If set to true, the files are uploaded first, then encrypted, and finally stored along with the thumbnail images which are encrypted as well. When accessing them, the parameter auth, which is specified with an encryption key of the user such as ?auth=RW5b2RIHaMdGV4eA==, should be added at the end of the file URLs. An encryption key managed internally by the Sendbird system is generated every time a user logs in to the Sendbird server and is valid for three days starting from the last login. The system mainly uses the key to check if a user is properly accessing the data of the application. (Default: false)
The thread information consisting of the reply count, most_replies, last_replied_at, and updated_at properties. The thread_info property is only retrieved if the message is a parent message.
thread_info.reply_count
long
The total number of replies in the thread. The value of 0 indicates that there is no reply.
thread_info.most_replies
array of objects
An array of one or more JSON objects containing the information of one or more users who replied the most. Up to five objects can be returned.
thread_info.last_replied_at
long
The time when the last reply was added in Unix milliseconds format. The value of 0 indicates that there is no reply.
thread_info.updated_at
long
The time when the thread information was updated due to a deleted or newly added reply in the thread, in Unix milliseconds format.
parent_message_id
long
The unique ID of a thread's parent message. This property is only retrieved if the message is a reply.
parent_message_info
nested object
The information of the thread's parent message including the text, user information, and message type. This property is only retrieved if the message is a reply.
is_reply_to_channel
boolean
Indicates whether the message was sent as a reply to the channel.
parent_message_text
string
(Deprecated)The text of a thread's parent message. If the include_parent_message_text parameter is set to true, the value of this property is retrieved in the response.
List of properties for an admin message
Property name
Type
Description
message_id
long
The unique ID of the message.
type
string
The type of the message. The value is ADMM for an admin message.
custom_type
string
The custom message type used for message grouping. The length is limited to 128 characters.
* Custom types are also used to segment metrics within Sendbird's Advanced analytics, which enables the sub-classification of data views.
channel_url
string
The unique URL of the channel where the message is sent to.
mention_type
string
The mentioning method that indicates who gets a notification of the message. The value of users indicates that only users specified in the mentioned_users property get notified, while the value of channel indicates that all users in the channel get notified.
mentioned_users[]
array of objects
An array of specific users who get a notification of the message.
is_removed
boolean
Indicates whether the message is removed from the channel.
message
string
The content of the message.
data
string
A string data which can contain additional message information such as custom font size, font type, or JSON formatted string.
sorted_metaarray
array of objects
An array of one or more JSON objects consisting of key-values items to store additional message information. When retrieving, items are returned in the exact order they've been initially added.
og_tag
nested object
The Open Graph (OG) metadata contained in the given URL when a text message or an admin message includes the URL of a web page. This consists of properties such as og:url, og:title, og:description, and og:image.