Skip to content

docs: describe limit/page query params for events API pagination - #4901

Open
SteveGilvarry wants to merge 1 commit into
ZoneMinder:masterfrom
SteveGilvarry:docs/api-events-pagination
Open

docs: describe limit/page query params for events API pagination#4901
SteveGilvarry wants to merge 1 commit into
ZoneMinder:masterfrom
SteveGilvarry:docs/api-events-pagination

Conversation

@SteveGilvarry

Copy link
Copy Markdown
Member

The API docs claimed events.json defaults to 25 entries per page tied to WEB_EVENTS_PER_PAGE. The API actually returns the full, unpaginated list unless limit and/or page query parameters are supplied, and WEB_EVENTS_PER_PAGE only affects the web event list (see EventsController — pagination engages on request params; the web-option coupling was deliberately removed).

Updates the pagination paragraph and the iteration pseudocode accordingly.

refs #3106

🤖 Generated with Claude Code

…oneMinder#3106

The API docs claimed events.json defaults to 25 entries per page tied to
WEB_EVENTS_PER_PAGE. The API actually returns the full list unless limit
and/or page query parameters are supplied, and WEB_EVENTS_PER_PAGE only
affects the web event list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 12, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ZoneMinder API documentation to correctly describe how pagination works for the events.json endpoint, aligning the docs with the actual behavior in EventsController (pagination only occurs when limit and/or page query parameters are provided).

Changes:

  • Corrects the pagination description for GET /api/events.json to reflect opt-in pagination via limit/page query params (and clarifies WEB_EVENTS_PER_PAGE is web-UI only).
  • Updates the pagination iteration example to include limit in the query string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/api.rst
Comment on lines +328 to +331
Note that the events list can be quite large. Without any parameters this endpoint
returns the full, unpaginated list. To paginate, pass ``limit`` (entries per page)
and/or ``page`` query parameters; supplying either enables pagination. The
WEB_EVENTS_PER_PAGE option only affects the web event list, not the API.
Comment thread docs/api.rst
Comment on lines +338 to 345
data = http://server/zm/api/events.json?limit=100&page=1 # this returns the first page
# The json object returned now has a property called data.pagination.pageCount
count = data.pagination.pageCount;
for (i=1, i<count, i++)
{
data = http://server/zm/api/events.json?page=i;
data = http://server/zm/api/events.json?limit=100&page=i;
doStuff(data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants