/ SDKs / Android
SDKs
Chat SDKs Android v4
Chat SDKs Android
Chat SDKs
Android
Version 4

List changelogs of messages

Copy link

Each message changelog has distinct properties such as the timestamp of an updated message or the unique ID of a deleted message. Based on these two properties, you can retrieve message changelogs using either the timestamp or the token. Both the getMessageChangeLogsSinceToken() and getMessageChangeLogsSinceTimestamp() methods require a parameter MessageChangeLogsParams object to determine which messages to return.

val params = MessageChangeLogsParams().apply {
    replyType = ReplyType.ALL // or ReplyType.ONLY_REPLY_TO_CHANNEL, ReplyType.NONE
    messagePayloadFilter = MessagePayloadFilter().apply {
        includeThreadInfo = INCLUDE_THREAD_INFO
        includeParentMessageInfo = PARENT_MESSAGE_INFO
    }
}

MessageChangeLogsParams

Copy link
Property nameTypeDescription

replyType

string

Specifies the type of message to include in the results.
- NONE (default): Includes unthreaded messages and only the parent messages of threaded messages.
- ALL: Includes both threaded and unthreaded messages.
- ONLY_REPLY_TO_CHANNEL: Includes unthreaded messages, parent messages of threaded messages, and messages sent to the channel as replies with the reply_to_channel property set to true.

includeThreadInfo

boolean

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

includeParentMessageInfo

boolean

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


By timestamp

Copy link

You can retrieve the message changelogs by specifying a timestamp. The results only include changelogs that were created after the specified timestamp.

Note: The getMessageChangeLogsByTimestamp method is deprecated. Accordingly, use the getMessageChangeLogsSinceTimestamp() method instead.

channel.getMessageChangeLogsSinceTimestamp(TIMESTAMP, params) { updatedMessages, deletedMessageIds, hasMore, token, e ->
    if (e != null) {
        // Handle error.
    }

    // A list of message changelogs created after the specified timestamp is successfully retrieved.
}

List of parameters

Copy link
Parameter nameTypeDescription

ts

long

Specifies a timestamp to be the reference point for the changelogs to be retrieved, in Unix milliseconds format.

params

MessageChangeLogsParams

Contains a set of parameters you can use when retrieving changelogs.


By token

Copy link

You can also retrieve message changelogs by specifying a token. The token is an opaque string that marks the starting point of the next page in the result set and it's included in the callback of the previous call. Based on the token, the next page starts with changelogs that were created after the specified token.

channel.getMessageChangeLogsSinceToken(TOKEN, params) { updatedMessages, deletedMessageIds, hasMore, token, e ->
    if (e != null) {
        // Handle error.
    }

    // A list of message changelogs created after the specified token is successfully retrieved.
}

List of parameters

Copy link
Parameter nameTypeDescription

token

string

Specifies a token to be the reference point for the changelogs to be retrieved.

params

MessageChangeLogsParams

Contains a set of parameters you can use when retrieving changelogs.