/ SDKs / .NET
SDKs
Chat SDKs .NET v4
Chat SDKs .NET
Chat SDKs
.NET
Version 4

List replies in a message thread

Copy link

You can retrieve replies to a message by identifying the parent message like the following. First, create a SbThreadedMessageListParams object and set properties related to the thread where the target replies belong to.

SbThreadedMessageListParams threadedMessageListParams = new SbThreadedMessageListParams
{
    PreviousResultSize = 10,
    NextResultSize = 10,
    IncludeParentMessageInfo = true,
    IsInclusive = true,
    Reverse = false
};

SbThreadedMessageListParams

Copy link

This table only contains properties shown in the code above. To see the comprehensive list of all available methods and properties, see SbThreadedMessageListParams.

Property nameTypeDescription

isInclusive

bool

Determines whether to include messages sent exactly on the specified timestamp or have the matching message ID.

PreviousResultSize

int

Specifies the number of messages to retrieve, which are sent previously before a specified timestamp. Note that the actual number of results may be larger than the set value when there are multiple messages with the same timestamp as the earliest message.

NextResultSize

int

Specifies the number of messages to retrieve, which are sent later after a specified timestamp. Note that the actual number of results may be larger than the set value when there are multiple messages with the same timestamp as the latest message.

IncludeParentMessageInfo

bool

Determines whether to include the information of the parent messages in the result. (Default: false)

reverse

bool

Determines whether to sort the retrieved messages in reverse order. If false, the results are in ascending order. (Default: false)

Using the timestamp of the parent message, you can retrieve the parent message with its replies by passing a SbThreadedMessageListParams object as an argument to the parameter in the GetThreadedMessagesByTimestamp() method.

SbThreadedMessageListParams threadedMessageListParams = new SbThreadedMessageListParams();

parentMessage.GetThreadedMessagesByTimestamp(TIMESTAMP, threadedMessageListParams, (inMessage, inMessages, inError) =>
{
    if (inError != null)
        return; //Handle error.
});

List of parameters

Copy link
Parameter nameTypeDescription

timestamp

int

Specifies the timestamp to be the reference point of message retrieval in Unix milliseconds format.