PubNub icon

PubNub

Interact with PubNub real-time messaging platform

History → Message Counts

AI-generated

Summary

Retrieve the total message count for a specified channel.

Inputs

  • channel (required) — Channel name to query for message counts.
  • historyOptions — Options for fetching history, such as count, start timetoken, end timetoken, include metadata, and include message actions.

Output shape

a JSON object containing a count field with the message count value

Response includes a count field; no pagination; additional fields may appear in extended responses.

Examples

Example 1: Obtain message count for channel 'general'

Resource: History, Operation: Message Counts, Channel: general (no extra options needed)

Discussion