#
Voting service
Služba zodpovedná za overovanie prichdádzajúceho tokenu a za prijímanie hlasu z volebného terminálu.
#
Popis API
#
hello__get
Code samples
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/gateway/voting-service-api/', headers = headers)
print(r.json())
GET /
Hello
Sample testing endpoint
Example responses
200 Response
null
Responses
Response Schema
#
vote_api_vote_post
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/gateway/voting-service-api/api/vote', headers = headers)
print(r.json())
POST /api/vote
Vote
Receives vote with valid token, validates the token, sotres the vote and invalidates the token.
Returns: 200: Vote was successfully stored 403: Token is invalid 409: The election is not running at the moment 422: Invalid request body
Body parameter
{
"voting_terminal_id": "string",
"payload": {
"encrypted_message": "string",
"encrypted_object": "string"
}
}
Parameters
Example responses
200 Response
null
Responses
Response Schema
#
token_validity_api_token_validity_post
Code samples
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/gateway/voting-service-api/api/token-validity', headers = headers)
print(r.json())
POST /api/token-validity
Token Validity
Checks if the provided token is valid.
Body parameter
{
"voting_terminal_id": "string",
"payload": {
"encrypted_message": "string",
"encrypted_object": "string"
}
}
Parameters
Example responses
200 Response
null
Responses
Response Schema
#
Schemas
#
Body_token_validity_api_token_validity_post
{
"voting_terminal_id": "string",
"payload": {
"encrypted_message": "string",
"encrypted_object": "string"
}
}
Body_token_validity_api_token_validity_post
#
Properties
#
Body_vote_api_vote_post
{
"voting_terminal_id": "string",
"payload": {
"encrypted_message": "string",
"encrypted_object": "string"
}
}
Body_vote_api_vote_post
#
Properties
#
HTTPValidationError
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
HTTPValidationError
#
Properties
#
ValidationError
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
ValidationError
#
Properties
#
VoteEncrypted
{
"encrypted_message": "string",
"encrypted_object": "string"
}
VoteEncrypted