With Sendbird's Chat Platform 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 Sendbird Dashboard.
* This isn't updated in real-time, but it's a snapshot of the user object when a message object is created.
mention_type
string
The mention type that indicates whether to call the attention of specific users or all users in the channel. The value of users indicates that up to ten users in mentioned_user_ids are notified of the mention, while the value of channel indicates that up to ten users in the channel are notified of the mention.
mentioned_users[]
array of objects
An array of users mentioned in the 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
Additional message information such as custom font size or font type in JSON or other formats. More details on what can be stored in this field are available here.
sorted_metaarray
array of objects
An array of JSON objects consisting of key-values items to store additional message information which can be used for classification and filtering. When retrieving, items are returned in the order they were added. More details on what can be stored in this field are available here.
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.
* This isn't updated in real-time, but it's a snapshot of the user object when a message object is created.
mention_type
string
The mention type that indicates whether to call the attention of specific users or all users in the channel. The value of users indicates that up to ten users in mentioned_user_ids are notified of the mention, while the value of channel indicates that up to ten users in the channel are notified of the mention.
mentioned_users[]
array of objects
An array of users mentioned in 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 order they were 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 to require an authentication key to verify if the file is being properly accessed. Only the user who uploaded the file or users who are in the channel where the file was uploaded should have access. The authentication 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. If set to false, Sendbird tries to access a file without any key. To access encrypted files, such as the files in the Sendbird server which are by default encrypted, the property must be set to true. (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 mention type that indicates whether to call the attention of specific users or all users in the channel. The value of users indicates that up to ten users in mentioned_user_ids are notified of the mention, while the value of channel indicates that up to ten users in the channel are notified of the mention.
mentioned_users[]
array of objects
An array of users mentioned in 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 order they were 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.