Votings (votings)

Requests

HTTP verb Endpoint Description

POST

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

Creating a new voting

GET

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

Getting the list of votings

GET

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

Getting voting data

PATCH

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

Modifying voting data

DELETE

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

Deleting a voting


Creating a new voting

Request

Field description: selector’s voting entity

Example request
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

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

{
  "id": "7f50172f-016d-6263-9795-50e54938780c",
"name": "Vote 1",


  "subject": "Question about setting a date for the strategic session: 10/12/2019",

  "cases": {

    "0": "Against",


    "1": "For",


    "2": "I abstain"
  }
}

Getting the list of votings

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 output.

limit

int

Maximum number of resources in the list.

order

array<object|str>

Sorting order of resources in the list.

flat

bool

Transformation of composite fields to flat form.

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

Response

Field description: selector’s voting entity

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

[
  {
    "id": "7f50172f-016d-6263-9795-50e54938780c",
"name": "Vote 1",


    "subject": "Question about setting a date for the strategic session: 10/12/2019",

    "state": "inited"
  },
  {
    "id": "a6247b8e-016d-6263-2fbc-50e54938780c",

    "name": "Vote 2",


    "subject": "Question about choosing a new system",
    "state": "inited"
  }
]

Getting voting data

Request

Table 2. Request parameters
Name Type Description

mask

str

List of fields to output.

flat

bool

Transformation of composite fields to flat form.

Example request
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

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

{
  "id": "7f50172f-016d-6263-9795-50e54938780c",
"name": "Vote 1",


  "subject": "Question about setting a date for the strategic session: 10/12/2019",

  "state": "closed",
  "cases": {

    "0": "Against",


    "1": "For",


    "2": "I abstain"
  },
  "results": {
    "83d41cb6-016d-5d75-6341-50e54938780c": "2",
    "83d41cb6-016d-5d75-6341-50e54938780c": "2"
  }
}

Modifying voting data

Fields prohibited for modification: id

Request

Field description: selector’s voting entity

Example request
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

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

{
  "id": "7f50172f-016d-6263-9795-50e54938780c",
"name": "Vote 1",


  "subject": "Question about setting a date for the strategic session: 10/12/2019",

  "state": "inited",
  "cases": {

    "0": "Against",


    "1": "For",


    "2": "I abstain"
  },
  "results": {}
}

Deleting a voting

Request

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

Response

Example response
HTTP/1.1 204 No Content