Overview
useFetchManyChatMessages returns a function that fetches a single page of conversation messages and resolves to the raw response. It stores nothing — no Redux, no socket subscription — so you own the resulting state.
This is the low-level fetcher shared by useLiveChatMessages (the live store-backed view) and useFetchManyChatMessagesWrapper (a batteries-included paginated list). Use it directly when you need full control; most apps will prefer the wrapper.
Because results never enter the live store, this is the right tool for filtered or read-only queries (e.g. only messages that have replies) that should not be polluted by live socket traffic. It is a point-in-time query — call it again to refresh.
Usage Example
Parameters
The ID of the conversation to query.
Restrict to thread replies of this message.
Keyset cursor (ISO timestamp): messages created before this. Mutually exclusive with
after.Keyset cursor (ISO timestamp): messages created after this. Mutually exclusive with
before.Page size (1–100). Defaults to
50.Sort by creation time.
When
true, the server populates the files field on each message.Optional filters.
filters.hasReplies (boolean): when true, returns only messages that have thread replies (threadReplyCount > 0); when false, only messages with none. Filters by thread replies, not quotings.Threads are one level deep, so
hasReplies: true together with parentId always returns an empty list — the response’s notice field explains why.Returns
APromise resolving to:
Messages for the requested page. See ChatMessage.
Whether more messages exist in the requested direction.
ISO timestamp of the oldest message in this page;
null if empty.ISO timestamp of the newest message in this page;
null if empty.Present only when a filter combination can’t return results — e.g.
hasReplies: true together with parentId. Explains why the list is empty.
