Browse SDKs · Android
Platform
SDKsAndroid

Get conversations by ID

Batch retrieve conversation records by a list of conversation IDs using getMultipleConversation().

Copy

Retrieve conversation snapshots in batches using a list of conversationID values. This is typically used for notification routing, quick syncs, or custom grouping interfaces.

Code example

OpenIMClient.getInstance().conversationManager.getMultipleConversation(
    new OnBase<List<ConversationInfo>>() {
        @Override
        public void onSuccess(List<ConversationInfo> conversations) {
            // conversations contains the retrieved ConversationInfo items.
        }

        @Override
        public void onError(int code, String error) {
            // code and error describe the failure.
        }
    },
    conversationIDs
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<List<ConversationInfo>>YesCallback delivering the asynchronous query results.
conversationIDsList<String>YesList of conversationID values to query. Filter empty strings and duplicate entries before calling.

Return value

The successful callback delivers a List<ConversationInfo> containing the matched conversations. Merge returned records into your local conversation cache using each item's conversationID as the primary key. If any queried IDs do not exist, they are omitted from the returned list.