Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/includes/authenticated_api/_attendees.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ 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
----------- | -----------
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`

<div></div>

Expand Down
9 changes: 9 additions & 0 deletions source/includes/authenticated_api/_cursor_pagination.md.erb
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 1 addition & 8 deletions source/includes/authenticated_api/_petitions.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
11 changes: 5 additions & 6 deletions source/includes/authenticated_api/_signatures.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -330,26 +330,25 @@ 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
}
}
```


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
--------- | -------
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`


<div></div>
Expand Down
Loading