Voting (votings)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/uc/selectors/<id>/votings

Creating a new vote

GET

/rest/v1/uc/selectors/<id>/votings

Getting the list of votes

GET

/rest/v1/uc/selectors/<id>/votings/<id_vot>

Obtaining voting data

PATCH

/rest/v1/uc/selectors/<id>/votings/<id_vot>

Changing voting data

DELETE

/rest/v1/uc/selectors/<id>/votings/<id_vot>

Deleting a vote


Creating a new vote

Request

Field Description: selector’s voting entity

Request example
POST /rest/v1/uc/selectors/2c51f8a2-016d-5d72-d44a-50e54938780c/votings HTTP/1.1
Content-Type: application/json; charset=utf-8

selector’s voting entity

Response

Field Description: selector’s voting entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "7f50172f-016d-6263-9795-50e54938780c",
  "name": "Vote 1",
  "subject": "Question on setting a date for the strategy session: 12.10.2019",
  "cases": {
    "0": "Opposed",
    "1": "To",
    "2": "Abstaining"
  }
}

Getting the list of votes

Request

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, name, result, state,.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/uc/selectors/2c51f8a2-016d-5d72-d44a-50e54938780c/votings?mask=id,state HTTP/1.1

Response

Field Description: selector’s voting entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "7f50172f-016d-6263-9795-50e54938780c",
    "name": "Vote 1",
    "subject": "Question on setting a date for the strategy session: 12.10.2019",
    "state": "inited"
  },
  {
    "id": "a6247b8e-016d-6263-2fbc-50e54938780c",
    "name": "Vote 2",
    "subject": "The question of choosing a new system",
    "state": "inited"
  }
]

Obtaining voting data

Request

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/uc/selectors/2c51f8a2-016d-5d72-d44a-50e54938780c/votings/a6247b8e-016d-6263-2fbc-50e54938780c HTTP/1.1

Response

Field Description: selector’s voting entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "7f50172f-016d-6263-9795-50e54938780c",
  "name": "Vote 1",
  "subject": "Question on setting a date for the strategy session: 12.10.2019",
  "state": "closed",
  "cases": {
    "0": "Opposed",
    "1": "To",
    "2": "Abstaining"
  },
  "results": {
    "83d41cb6-016d-5d75-6341-50e54938780c": "2"
  }
}

Changing voting data

Fields prohibited for modification: id

Request

Field Description: selector’s voting entity

Request example
PATCH rest/v1/uc/selectors/2c51f8a2-016d-5d72-d44a-50e54938780c/votings/a6247b8e-016d-6263-2fbc-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

selector’s voting entity

Response

Field Description: selector’s voting entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "7f50172f-016d-6263-9795-50e54938780c",
  "name": "Vote 1",
  "subject": "Question on setting a date for the strategy session: 12.10.2019",
  "state": "inited",
  "cases": {
    "0": "Opposed",
    "1": "To",
    "2": "Abstaining"
  },
  "results": {}
}

Deleting a vote

Request

Request example
DELETE rest/v1/uc/selectors/2c51f8a2-016d-5d72-d44a-50e54938780c/votings/a6247b8e-016d-6263-2fbc-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content