Skip to content

api endpoints

Marcel Wrzos-Kaminski edited this page Mar 21, 2020 · 1 revision

Vengeful-Vinyard api specification v1.0

Api endpoints:

/groups/<group_name>/

returns following fields for each group:

members: list of user_id of users in group

used:

GET members in group for leaderboard view

/users/<user_id>/

returns following fields for each user:

name: name of user groups: list of the names of groups user is member of

used:

GET all groups of the current user

/punishment_types/<type_name>/

returns following fields for each punishment type:

name: name of punishment type value: integer of the value of the punishment in NOK image: icon of the punishment type represented somehow

used:

GET all punishment types for leaderboard view PUT new punishment types

note:

DEL and PATCH are forbidden, to not mess up existed punishments (alternatively only forbidden if punishments using the type exist)

/punishment/<punishment_id>

returns following fields for each punishment:

to: user_id of user who recieved the punishment giver: user_id of user who gave the punishment group: group in which the punishment was given type: name of the punishment type reason: explanation provided by giver on creation date: date punishment was created active: boolean whether or not punishment remains unpaid

used:

PUT new punishment PATCH change status of existing punishment DEL delete punishment

note:

"Amount" feature from Redwine not present currently

/groups/<group_name/users/<user_id>/

returns following fields for each user:

name: name of the user punishments_in_group: list of punishments user has recieved that are in the group. Each punishment is represented with the same fields as in /punishments/ punishments_in_group_sum: sum of the value of punishments

used:

GET the punishments of user in a specific group for leaderboard view

note:

punishments_in_group__to and punishmets_in_group__group are implied, can be omited

note:

"wall of shame" url and behavior currently not defined