diff --git a/source/includes/authenticated_api/_attendees.md.erb b/source/includes/authenticated_api/_attendees.md.erb index 8dbbd597e9d..7dca2f593f1 100644 --- a/source/includes/authenticated_api/_attendees.md.erb +++ b/source/includes/authenticated_api/_attendees.md.erb @@ -224,7 +224,7 @@ Permanently deletes the attendee with the specified ID. List the attendees that have RSVPed to an Event. -<%= partial "includes/shared/pagination.md" %> +<%= partial "includes/authenticated_api/cursor_pagination.md.erb", locals: {item_type_singular: 'attendee', item_type_plural: 'attendees'} %> Hash | Description ----------- | ----------- @@ -232,7 +232,7 @@ meta | pagination information event | basic information about the event attendees | an array of attendee results -`GET /api/v1/events/deliver-the-petition-to-the-wizard/attendees?page=2` +`GET /api/v1/events/deliver-the-petition-to-the-wizard/attendees?since_id=123&per_page=25`
diff --git a/source/includes/authenticated_api/_cursor_pagination.md.erb b/source/includes/authenticated_api/_cursor_pagination.md.erb new file mode 100644 index 00000000000..f6772d8b286 --- /dev/null +++ b/source/includes/authenticated_api/_cursor_pagination.md.erb @@ -0,0 +1,9 @@ +Pass the `since_id` parameter with a <%= item_type_singular %> ID, and a `per_page` parameter to control the number of <%= item_type_plural %> returned per page. The default for the latter is 10 <%= item_type_plural %> per page, and the maximum is 100. + +The response returns up to `per_page` <%= item_type_plural %> with IDs greater than `since_id` in ascending order by ID. To retrieve the first page, use `since_id=0`. + +The meta object includes: + +- `next_since_id`: the value to pass as `since_id` when requesting the next page. +- `has_more`: whether additional <%= item_type_plural %> are available. +- `per_page`: the requested number of <%= item_type_plural %> per page. diff --git a/source/includes/authenticated_api/_petitions.md.erb b/source/includes/authenticated_api/_petitions.md.erb index b8a40ae09f1..30274d5fcb6 100644 --- a/source/includes/authenticated_api/_petitions.md.erb +++ b/source/includes/authenticated_api/_petitions.md.erb @@ -211,15 +211,8 @@ the petition `slug` is `save-our-library`. ``` Get a paginated list of all petitions, including petitions that are unlaunched or otherwise not visible to the public. Each petition includes the same data returned by the single-petition endpoint. -Pass the `since_id` parameter with a petition ID, and a `per_page` parameter to control the number of petitions returned per page. The default for the latter is 10 petitions per page, and the maximum is 100. -The response returns up to `per_page` petitions with IDs greater than `since_id` in ascending order by ID. To retrieve the first page, use `since_id=0`. - -The meta object includes: - -- `next_since_id`: the value to pass as `since_id` when requesting the next page. -- `has_more`: whether additional petitions are available. -- `per_page`: the requested number of petitions per page. +<%= partial "includes/authenticated_api/cursor_pagination.md.erb", locals: {item_type_singular: 'petition', item_type_plural: 'petitions'} %> `GET /api/v1/petitions?since_id=0` diff --git a/source/includes/authenticated_api/_signatures.md.erb b/source/includes/authenticated_api/_signatures.md.erb index 10e69b19c78..f53a38ae303 100644 --- a/source/includes/authenticated_api/_signatures.md.erb +++ b/source/includes/authenticated_api/_signatures.md.erb @@ -330,10 +330,9 @@ Permanently deletes the signature with the specified ID. Note that this will dec } ], "meta": { - "current_page": 2, - "total_pages": 2, - "previous_page": 1, - "next_page": null + "next_since_id": 123, + "has_more": true, + "per_page": 25 } } ``` @@ -341,7 +340,7 @@ Permanently deletes the signature with the specified ID. Note that this will dec List the signatures that are part of a Petition. -<%= partial "includes/shared/pagination.md" %> +<%= partial "includes/authenticated_api/cursor_pagination.md.erb", locals: {item_type_singular: 'signature', item_type_plural: 'signatures'} %> Hash | Description --------- | ------- @@ -349,7 +348,7 @@ meta | pagination information petition | basic information about the petition signatures | an array of signature results -`GET /api/v1/petitions/no-taxes-on-tea/signatures?page=2` +`GET /api/v1/petitions/no-taxes-on-tea/signatures?since_id=123&per_page=25`