Options
The Options API supports managing poll options.
Get poll option
Gets a poll option.
GET /api/options/{id}
Path parameters
id
integer requiredId of the option.
Response codes
200 Success
{
"id": "integer",
"text": "string",
"vote_count": "integer",
"has_voted": "boolean",
"voters": [
"object"
]
}
404 Not Found
Code sample
curl https://{WEAVY-SERVER}/api/options/1
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Vote
Vote for a poll option.
POST /api/options/{id}/vote
Path parameters
id
integer requiredId of the poll option.
Response codes
200 Success
{
"id": "integer",
"text": "string",
"vote_count": "integer",
"has_voted": "boolean",
"voters": [
"object"
]
}
Code sample
$ curl -X POST {WEAVY_SERVER}/api/options/1/vote
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Get voters
List users that voted for the specified poll option.
GET /api/options/{id}/voters
Path parameters
id
integer requiredOption id.
Response codes
200 Success
[
{
"id": "integer",
"uid": "string",
"display_name": "string",
"username": "string",
"email": "string",
"given_name": "string",
"middle_name": "string",
"name": "string",
"family_name": "string",
"nickname": "string",
"phone_number": "string",
"comment": "string",
"directory_id": "integer",
"picture_id": "integer",
"avatar_url": "string",
"metadata": "object",
"tags": [
"string"
],
"presence": "string",
"created_at": "string",
"modified_at": "string",
"is_admin": "boolean",
"is_suspended": "boolean",
"is_trashed": "boolean"
}
]
Code sample
curl https://{WEAVY-SERVER}/api/options/1/voters
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"