Browse SDKs · WASM
SDKsWASMEnterprise

Load message history in reverse

Retrieve history from a message anchor toward newer messages.

Copy

Use the reverse history API when you already have a message anchor and need to fill in messages that come after it.

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesID of the conversation whose messages to retrieve.
startClientMsgIDstringYesAnchor message ID from which to read toward newer messages.
countnumberYesMaximum number of messages to retrieve.
viewTypeViewTypeYesMessage viewing direction. Use ViewType.History when loading history.
import { ViewType } from '@openim/wasm-client-sdk';

const { data: page } =
  await openimsdk.getAdvancedHistoryMessageListReverse({
    conversationID,
    startClientMsgID: anchorMessage.clientMsgID,
    count: 30,
    viewType: ViewType.History,
  });

When the Promise resolves, data is an AdvancedGetMessageResult. For field descriptions and result-status handling, see Load message history. On this page, isEnd indicates whether the query has reached the boundary in the newer-message direction.

Do not mix both loading directions at the same scroll boundary. Deduplicate merged results by conversationID:clientMsgID.