List polls OAuth Scope: polls:read

Retrieve all polls belonging to a specific publication. Poll choices are always included. Use expand[]=stats to include aggregate vote counts per choice.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

publicationIdstringRequiredformat: "^(pub_[0-9a-fA-F\-]+)$"
The prefixed ID of the publication object

Query parameters

limitintegerOptional
A limit on the number of objects to be returned. The limit can range between 1 and 100, and the default is 10.
cursorstringOptional

Cursor-based pagination (recommended): Use this opaque cursor token to fetch the next page of results. When provided, pagination will use cursor-based method which is more efficient and consistent than offset-based pagination.

pageintegerOptional

Offset-based pagination (deprecated): Page number for offset-based pagination. Please migrate to cursor-based pagination using the cursor parameter. If not specified, results 1-10 from page 1 will be returned.

order_byenumOptionalDefaults to created

The field that the results are sorted by. Defaults to created.
created - The time the poll was created.
name - The name of the poll.

Allowed values:
directionenumOptionalDefaults to asc

The direction that the results are sorted in. Defaults to asc.
asc - Ascending, sorts from smallest to largest.
desc - Descending, sorts from largest to smallest.

Allowed values:
expand[]list of enumsOptional
Optionally expand the response to include additional data.<br> `stats` - Returns aggregate vote counts per choice and total completions.<br> `poll_responses` - Returns up to 10 most recent subscriber responses. Use /polls/{pollId}/responses for paginated access to all responses.<br> `trivia_answer` - Returns the correct answer for trivia-type polls.
Allowed values:
post_idstringOptional

Filter to only return polls that were embedded in the specified post. Accepts a prefixed post ID (e.g. post_abc123).

Response

OK
datalist of objects
An array of polls.
limitinteger or null
The limit placed on the results. If no limit was specified in the request, this defaults to 10.
pageinteger or null>=0Defaults to 1

Offset pagination only: The page number the results are from. Only present when using deprecated offset-based pagination.

total_pagesinteger or null

Offset pagination only: The total number of pages. Only present when using deprecated offset-based pagination.

has_moreboolean or null

Cursor pagination only: Indicates whether there are more results available after the current page. Only present when using cursor-based pagination.

next_cursorstring or null

Cursor pagination only: The cursor token to use for fetching the next page of results. This will be null if has_more is false. Only present when using cursor-based pagination.

total_resultsinteger or null
The total number of results from all pages.

Errors