Possible to fetch messages by message id(s)?

i am using sendbird sdk 3.0.143.

Is it possible to fetch messages by array of message id(s)? Let’s say I did send different messages, some of them got reply from other users, how could I get those reply messages back?

I assume using parentMessageId to indicate a specific message is a reply, then I have to exchange the full message details by using those message keys, but what I found from SDK is getMessagesByMessageId in which intake 1 message id only.

Unfortunately, there is no way to retrieve the messages via an array of message-ids. But if you want to know and take the reply messages, you can use the SendBird.ChannelHandler.

ChannelHandler.onThreadInfoUpdated callback will call the changes whenever the message’s thread information changed. If the callback is called you can receive the message and then you also can retrieve the messages via BaseChannel.getMessagesByMessageId function.

Hi darylsze,

If you want to retrieve the reply messages of a specific parent message, you can use

BaseMessage.getThreadedMessagesByTimestamp(long, ThreadMessageListParams, GetThreadedMessagesHandler)

where the “BaseMessage” would be the parent message object.

If what you want is to get all messages + reply messages at the same time, you can use either one of the methods below:

BaseChannel.getMessagesByTimestamp(long, MessageListParams, GetMessagesHandler)
BaseChannel.getMessagesById(long, MessageListParams, GetMessagesHandler)

with MessageListParam.setIncludeReplies(true).