Voting¶
- POST /vote/(int: group_id)/¶
Authenticated request
Cast a vote for a group. A user can cast a vote in a single group per day.
Header Authorization: Access token from ‘/token/’.
Status Codes: - 200 – Success
- 400 – Request MUST be in JSON format (RequestMustBeJSONException)
- 400 – Missing fields (MissingFieldsException)
- 403 – User is not member of this group (UserIsNotMemberException)
- 404 – User not found (via token) (UserNotFoundException)
- 404 – Group not found (ElementNotFoundException)
- 404 – Place not found (ElementNotFoundException)
- 404 – Place doesn’t belong to the group (PlaceDoesntBelongToGroupException)
- 406 – User already voted today (VoteAlreadyCastException)
- 406 – Number of places vote doesn’t match the required (InvalidNumberOfPlacesCastedException)
- 409 – Places voted more than once (PlacesVotedMoreThanOnceException)
- 412 – Authorization required (AuthorizationRequiredException)
- GET /vote/(int: group_id)/¶
Authenticated request
Return the current voting status for the group.
Header Authorization: Access token from ‘/token/’.
Status Codes: - 200 –
Success
HTTP/1.1 200 OK Content-type: application/json { "status": "OK", "closed": <True if all members voted>, "results": [ {"id": <place id>, "name": "<place name>", "points": <points> }, {"id": <place id>, "name": "<place name>", "points": <points> }, ... ] } - 403 – User is not member of this group (UserIsNotMemberException)
- 404 – User not found (via token) (UserNotFoundException)
- 404 – Group not found (ElementNotFoundException)
- 412 – Authorization required (AuthorizationRequiredException)
- 200 –