Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Crypto-Project-ENSTA/back-end/llms.txt

Use this file to discover all available pages before exploring further.

Call this endpoint to read the current election results after the counting phase has run. The response contains the total number of valid votes processed and a per-candidate breakdown of counts and percentages. Only votes with a valid status are included — votes rejected due to an invalid signature or invalid N2 fingerprint are never counted. Results are populated by POST /voting/end-vote; the endpoint returns an empty tally until counting has occurred.

Request

GET /results/tally This endpoint takes no request body and no query parameters.

Response

total_votes
integer
required
The total number of valid votes counted across all candidates.
tally
array
required
A list of per-candidate result objects. Empty when no valid votes have been counted yet.

HTTP status codes

CodeMeaning
200Tally returned successfully. The tally array may be empty if no valid votes have been counted yet.
500Internal server error while retrieving results.

Response examples

Results are populated when POST /voting/end-vote is called. Once the election is closed and votes are counted, the tally is stable and read-only.

Example

curl -X GET https://your-api/results/tally
{
  "total_votes": 5,
  "tally": [
    {"candidate": "A", "count": 3, "percentage": 60.0},
    {"candidate": "B", "count": 2, "percentage": 40.0}
  ]
}

Build docs developers (and LLMs) love