Skip to content

List who voted on a poll

GET
/chats/{chat}/messages/{message}/poll/voters
curl --request GET \
--url https://chat.work.optidata.cloud/api/chats/36/messages/176/poll/voters \
--header 'Authorization: Bearer <token>'

The voters of the poll carried by the message, grouped by the option they picked. Deleted users are left out of both the groups and the counts.

chat
required
integer format: int64

Numeric id of the conversation.

message
required
integer format: int64

Numeric id of the message.

The poll’s voters and per-option counts.

Media typeapplication/json
object
poll_voters
required

Voters keyed by option id.

object
key
additional properties
Array<object>

A user who voted on a poll option.

object
id
integer format: int64
uuid
string format: uuid
name
string
username
string | null
email
string format: email
deleted_at
string | null format: date-time
poll_options
required
Array<object>

One answer of a poll.

object
id
integer format: int64
content
string
<= 255 characters
position

Display order, starting at 0.

integer
votes_count
required

Vote counts keyed by option id, plus an All key with the total.

object
key
additional properties
integer
Examples
Examplevoters
{
"poll_voters": {
"11": [
{
"id": 5,
"uuid": "7c2f4b18-a90d-4d6e-8f11-2b5c9e70a334",
"name": "John Smith",
"username": null,
"email": "john.smith@acme.example",
"deleted_at": null
}
],
"12": []
},
"poll_options": [
{
"id": 11,
"content": "Monday",
"position": 0
},
{
"id": 12,
"content": "Tuesday",
"position": 1
}
],
"votes_count": {
"11": 1,
"12": 0,
"All": 1
}
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures — and a few permission denials — use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller is not a participant of the conversation, or lacks the role the operation requires.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The resource does not exist, or does not belong to the given conversation.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Chat\\Chat] 99999999"
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}