Retrieves a list of past messages of a specific channel.
Note: This action returns a list of messages in the order they were created. Replies in threaded messages are also listed in the chronological order of their creation like other messages, not grouped with their parent messages.
The following table lists the parameters that this action supports.
include_reply_typeparameters are related to Sendbird's message threading feature. To learn more, see Message threading.
Specifies the type of the channel. Acceptable values are open_channels and group_channels.
Specifies the URL of the channel.
Specifies the timestamp to be the reference point of the query in Unix milliseconds. Either this or the
Specifies the unique ID of the message to be the reference point of the query. Either this or the
Specifies the number of previously sent messages to retrieve before
Specifies the number of sent messages to retrieve after
Determines whether to include messages sent exactly on the specified
Determines whether to sort the results in reverse chronological order. If set to true, messages appear in reverse chronological order where the newest comes first and the oldest last. (Default: false)
Restricts the search scope to only retrieve messages sent by the user with the specified ID.
Restricts the search scope to only retrieve messages sent by one or more users with the specified IDs listed in a comma-separated string.
Restricts the search scope to only retrieve messages sent by operators or non-operator users of the channel. Acceptable values are all, operator, and nonoperator. (Default: all)
Specifies a message type to retrieve. Acceptable values are MESG, FILE, and ADMM. If not specified, all messages are retrieved.
Specifies a comma-separated string of one or more custom message types to retrieve. The value set to this parameter can serve as a filter as follows:
Determines whether to include messages removed from the channel in the results. (Default: false)
Determines whether to include information of the parent message in the results. (Default: false)
Determines whether to include thread information in the results. (Default: false)
Specifies the type of message to include in the results.
Determines whether to include reactions added to messages in the channel in the results. (Default: false)
Determines whether to include the
Determines whether to retrieve messages from a subchannel where the user specified in the
Specifies the unique ID of a user to restrict the scope to the user's subchannel. Messages in the user's subchannel are retrieved. This parameter should be specified in conjunction with the
(Deprecated) Specifies the custom message type to filter the messages with the corresponding custom type. If not specified, all messages are retrieved.
(Deprecated) Determines whether to include the
(Deprecated) Determines whether to include replies as messages in the results. If set to true, all messages including replies, ones without replies, and ones with a thread of replies are returned in the results in chronological order. (Default: false)
(Deprecated) Determines whether to include the text of parent messages as the
Note : To access an encrypted file in a file message, you can use an HTTP GET request containing an
Api-Tokenheader specified with either your master API token or secondary API token regardless of the
require_authparameter. The URL of the encrypted file you want to retrieve should be specified in the request.
If successful, this action returns a list of message resources that match the specified parameters in the response body.
Note: Sendbird Chat SDK supports the generation of a URL link preview within a message if the given URL has Open Graph (OG) tags, which are included as an
og_tagproperty in your response as well. This feature is turned on by default for Sendbird applications. To enable this functionality, visit this page.
array of objects
An array of messages that match the specified optional parameters.
In the case of an error, an error object is returned. A detailed list of error codes is available here.