Options
The Options API supports managing poll options.
Get poll option
Get details (including votes) for a poll option.
GET /api/options/{id}
Path parameters
id
integer
requiredId of the option.
Example request
curl {WEAVY-URL}/api/options/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
404 Not Found
Response schema
{
"id": "integer",
"text": "string",
"votes": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"has_voted": "boolean"
}
List post options
List poll options (including votes) for the specified post.
GET /api/posts/{id}/options
Path parameters
id
integer
requiredId of the post.
Example request
curl {WEAVY-URL}/api/posts/1/options
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
Response schema
{
"data": [
{
"id": "integer",
"text": "string",
"has_voted": "boolean"
}
],
"start": "integer",
"end": "integer",
"count": "integer"
}
List comment options
List poll options (including votes) for the specified comment.
GET /api/comments/{id}/options
Path parameters
id
integer
requiredId of the comment.
Example request
curl {WEAVY-URL}/api/comments/1/options
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
Response schema
{
"data": [
{
"id": "integer",
"text": "string",
"has_voted": "boolean"
}
],
"start": "integer",
"end": "integer",
"count": "integer"
}
List message options
List poll options (including votes) for the specified message.
GET /api/messages/{id}/options
Path parameters
id
integer
requiredId of the message.
Example request
curl {WEAVY-URL}/api/messages/1/options
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
Response schema
{
"data": [
{
"id": "integer",
"text": "string",
"has_voted": "boolean"
}
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Vote on poll
Cast a vote (for the authenticated user) on a poll option.
POST /api/options/{id}/vote
Path parameters
id
integer
requiredId of the poll option.
Example request
curl -X POST {WEAVY-URL}/api/options/1/vote
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
403 Forbidden
404 Not Found
Response schema
{
"id": "integer",
"text": "string",
"votes": {
"data": [
"object"
],
"start": "integer",
"end": "integer",
"count": "integer"
},
"has_voted": "boolean"
}