Get poll results
GET
/api/polls/{pollId}/results
const url = 'http://localhost:3001/api/polls/example/results';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3001/api/polls/example/results \ --header 'Authorization: <Authorization>'Retrieve detailed voting results for a poll
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”pollId
required
string
Poll ID
Responses
Section titled “Responses”OK
Media typeapplication/json
object
message
string
poll
object
allows_multiple
boolean
created_at
string
creator_address
string
expires_at
string
has_voted
boolean
id
string
is_expired
boolean
options
Array<object>
object
has_voted
Whether current user voted for this option
boolean
id
string
poll_id
string
text
string
vote_count
integer
question
string
total_votes
integer
success
boolean
Examplegenerated
{ "message": "example", "poll": { "allows_multiple": true, "created_at": "example", "creator_address": "example", "expires_at": "example", "has_voted": true, "id": "example", "is_expired": true, "options": [ { "has_voted": true, "id": "example", "poll_id": "example", "text": "example", "vote_count": 1 } ], "question": "example", "total_votes": 1 }, "success": true}Bad Request
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Unauthorized
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Not Found
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}