Instance hosters should be able to set custom badges for users on the site, eg. Winner of Level Competition X, which should display on their profile as an icon, and show a title + description when hovered over
badges will comprise of this data structure
{
"id": "GUID_HERE",
"icon": "https://url.png",
"title": "Winner of Level Competition X",
"description": "Created [level](https://levelurl), which recieved the most votes during Level Competition X",
}
Description should support markdown/bbcode to allow for links/formatting
API Endpoints
POST => /api/v3/badges/create, takes a body of the above datastructure without the ID, returns the full data structure with the newly generated ID
PATCH => /api/v3/badges/id/{id}, takes a body of the above datastructure, updates the badge at that ID with the new information
DELETE => /api/v3/badges/id/{id}, deletes the badge at that ID, removing it from all users which had it
GET => /api/v3/badges/id/{id}, returns the badge datastructure with that specific GUID
POST => /api/v3/badges/add/{id}/{user_id}, adds the specified badge to the specified user
POST => /api/v3/badges/remove/{id}/{user_id}, removes the specified badge from the specified user
Existing user endpoints like /api/v3/users/name/{username} will also have a badges field, which is an array of badge GUIDs (or maybe full badge data structures to reduce the amount of requests needed?)
Questions
This is tangentially related to #20, but i think this covers a different usecase than the current roles implementation provides
Should this just be an extension to the current roles system?
eg. badge information is associated with a role you give to players rather than its own data object which is assigned
Summary
Instance hosters should be able to set custom badges for users on the site, eg.
Winner of Level Competition X
, which should display on their profile as an icon, and show a title + description when hovered overbadges will comprise of this data structure
Description should support markdown/bbcode to allow for links/formatting
API Endpoints
POST => /api/v3/badges/create
, takes a body of the above datastructure without the ID, returns the full data structure with the newly generated IDPATCH => /api/v3/badges/id/{id}
, takes a body of the above datastructure, updates the badge at that ID with the new informationDELETE => /api/v3/badges/id/{id}
, deletes the badge at that ID, removing it from all users which had itGET => /api/v3/badges/id/{id}
, returns the badge datastructure with that specific GUIDPOST => /api/v3/badges/add/{id}/{user_id}
, adds the specified badge to the specified userPOST => /api/v3/badges/remove/{id}/{user_id}
, removes the specified badge from the specified userExisting user endpoints like
/api/v3/users/name/{username}
will also have abadges
field, which is an array of badge GUIDs (or maybe full badge data structures to reduce the amount of requests needed?)Questions
This is tangentially related to #20, but i think this covers a different usecase than the current roles implementation provides
Should this just be an extension to the current roles system? eg. badge information is associated with a role you give to players rather than its own data object which is assigned