Options

The Options API supports managing poll options.

Get poll option

GET /api/options/{id}

Gets a poll option.

Sample request

$ curl {WEAVY_SERVER}/api/options/1
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Id of the option.

Responses

Status code 200

application/json

{
  "id": "integer",
  "text": "string",
  "vote_count": "integer",
  "has_voted": "boolean",
  "voters": [
    "object"
  ]
}
Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Vote

POST /api/options/{id}/vote

Vote for a poll option.

Sample request

$ curl -X POST {WEAVY_SERVER}/api/options/1/vote
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Id of the option.

Responses

Status code 200

application/json

{
  "id": "integer",
  "text": "string",
  "vote_count": "integer",
  "has_voted": "boolean",
  "voters": [
    "object"
  ]
}

Get voters

GET /api/options/{id}/voters

List users that voted for the specified option.

Sample request

$ curl {WEAVY_SERVER}/api/options/1/voters
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Option id.

Responses

Status code 200

application/json

{}

Weavy Docs