Skip to content

Read a poll with its votes

GET
/posts/polls/{poll}/votes
curl --request GET \
--url https://feed.work.optidata.cloud/api/posts/polls/140/votes \
--header 'Authorization: Bearer <token>'

A poll, its options and the votes on each.

poll
required
integer

Numeric id of the poll.

The poll.

Media typeapplication/json
object
id
required
integer
question
required
string
duration_days
integer
Allowed values: 1 3 7 14
pollable_type
string
pollable_id
integer
options
required
Array<object>
object
id
required
integer
poll_id
required
integer
label
required
string
created_at
string format: date-time
updated_at
string format: date-time
created_at
string format: date-time
updated_at
string format: date-time
options
required
Array
object
id
required
integer
poll_id
required
integer
label
required
string
created_at
string format: date-time
updated_at
string format: date-time
votes
Array<object>
object
id
required
integer
poll_option_id
required
integer
user_id
required
integer
created_at
string format: date-time
updated_at
string format: date-time
Examples
Exampleexample
{
"id": 140,
"question": "Which date works best?",
"duration_days": 7,
"pollable_type": "App\\Models\\Post",
"pollable_id": 2290,
"created_at": "2026-10-19T14:38:27.000000Z",
"updated_at": "2026-10-19T14:38:27.000000Z",
"options": [
{
"id": 616,
"poll_id": 140,
"label": "Monday",
"created_at": "2026-10-19T14:38:27.000000Z",
"updated_at": "2026-10-19T14:38:27.000000Z",
"votes": [
{
"id": 506,
"poll_option_id": 616,
"user_id": 38,
"created_at": "2026-10-19T14:39:04.000000Z",
"updated_at": "2026-10-19T14:39:04.000000Z"
}
]
},
{
"id": 617,
"poll_id": 140,
"label": "Tuesday",
"created_at": "2026-10-19T14:38:27.000000Z",
"updated_at": "2026-10-19T14:38:27.000000Z",
"votes": []
}
]
}

No authentication key was sent.

Media typeapplication/json

Authentication failures use an error key.

object
error
required
string
Examples
Exampleexample
{
"error": "JWT passport exception: Missing bearer token in request"
}

No matching resource, or it is not reachable through this path.

Media typeapplication/json
object
message
required
string
Examples
Exampleexample
{
"message": "No query results for model [App\\Models\\Category] 864"
}

The authentication key is expired or not recognised. Get a fresh one and retry.

Media typeapplication/json

Authentication failures use an error key.

object
error
required
string
Examples
Exampleexample
{
"error": "JWT passport expired: Passport expired"
}