Get a poll's results
GET
/api/v1/newsletter/polls/{id}/results
const url = 'https://digize.com/api/v1/newsletter/polls/example/results';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://digize.com/api/v1/newsletter/polls/example/results \ --header 'x-api-key: <x-api-key>'A poll’s question and answers for the workspace’s site, with each answer’s votes and share when the poll shows its results (null when it doesn’t). A page calls it with the publishable key; the poll block’s web HTML names the poll in data-poll-id.
Needs the newsletter:read permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Responses
Section titled “Responses”Done
Media typeapplication/json
object
id
required
string
question
required
string
showResults
required
boolean
options
required
Array<object>
object
label
required
string
votes
required
number | null
share
required
0 to 1.
number | null
votes
required
Readers who answered.
number | null
Example generated
{ "id": "example", "question": "example", "showResults": true, "options": [ { "label": "example", "votes": 1, "share": 1 } ], "votes": 1}What was sent isn’t valid (invalid).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}