Download OpenAPI specification:Download
Direct Decisions REST API provides the core Direct Decisions functionalities over HTTP.
It covers creating votings, changing choices and deleting votings, submitting ballots for voting, re-voting, removing votes and calculating the results of the voting. All operations can be done independently. There are no voting stages and all operations can be done at any time. All voting restrictions are left for the client to impose.
choices | Array of strings (Choices) <= 1000 items [ items <= 1000 characters ] A list of choices in a particular order. |
{- "choices": [
- "string"
]
}
{- "id": "f6291725fcaf4e2bd399",
- "choices": [
- "string"
]
}
This endpoint combines all possible modifications of the choices list elements.
To add a new choice, provide its value as a string and an index where it should be placed in the list. For example, index 0 will append a new choice, while index equal to the number of choices will prepend it. For any other index number between, the choice will be inserted at that position.
To remove a choice, provide the exact choice value as the string and set index to -1 value.
To move an existing choice to a new position, provide the exact choice value as the string and its new position as the index.
voting-id required | string (VotingID) ^[a-f0-9]{20}$ Example: f6291725fcaf4e2bd399 |
choice | string |
index | integer >= -1 0-based position in the choices list. |
{- "choice": "string",
- "index": -1
}
{- "choices": [
- "string"
]
}
voting-id required | string (VotingID) ^[a-f0-9]{20}$ Example: f6291725fcaf4e2bd399 |
voter-id required | string (VoterID) <= 1000 characters |
{- "ballot": {
- "property1": 0,
- "property2": 0
}
}
voting-id required | string (VotingID) ^[a-f0-9]{20}$ Example: f6291725fcaf4e2bd399 |
voter-id required | string (VoterID) <= 1000 characters |
object (Ballot) |
{- "ballot": {
- "property1": 0,
- "property2": 0
}
}
{- "revoted": true
}
voting-id required | string (VotingID) ^[a-f0-9]{20}$ Example: f6291725fcaf4e2bd399 |
{- "ballot": {
- "results": [
- {
- "choice": "string",
- "index": 3,
- "wins": 0,
- "percentage": 0.25,
- "strength": 0,
- "advantage": 0
}
], - "tie": true
}
}
Duels are pairwise comparisons between choices that can be used to display breakdowns of the voting preferences. The response includes both duels and results to ensure consistency between them.
voting-id required | string (VotingID) ^[a-f0-9]{20}$ Example: f6291725fcaf4e2bd399 |
{- "ballot": {
- "results": [
- {
- "choice": "string",
- "index": 3,
- "wins": 0,
- "percentage": 0.25,
- "strength": 0,
- "advantage": 0
}
], - "tie": true,
- "duels": [
- null
]
}
}