Get poll
GET
/api/polls/{pollId}
const url = 'http://localhost:3001/api/polls/example';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 \ --header 'Authorization: <Authorization>'Retrieve a specific poll by ID with its current voting results
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}