tl;dr I would like to have a route to a badge based on the id in SEDE.
In SEDE we have a table Badges(Id, UserId, Name, Date, Class, TagBased).
For me the first few badges look like this:
Id | UserId | Name | Date | Class | TagBased
------------------------------------------------------------------------
1361955 | 578411 | Autobiographer |2011-01-19 17:15:25| 3 | false
1367877 | 578411 | Teacher |2011-01-21 15:16:02| 3 | false
1369965 | 578411 | Editor |2011-01-22 13:47:17| 3 | false
I really want to create a link to those badges with functionality provided in SEDE. Unfortunately the link on Stack Overflow for my teacher badge is
https://stackoverflow.com/help/badges/1/teacher?userid=578411
We don't have that magic 1 between badges and teacher, which is confirmed by Tim Stone in The Tavern. It wouldn't all be that bad if those numbers were stable across the network (at least for the named badges) but they aren't
Note that badge ids are not constant across sites, and thus should be looked up via the /badges method. A badge id on a single site is, however, guaranteed to be stable.
I would have to write a script for the API to retrieve all badges from all sites and convert that to a SQL insert script...and that needs to be updated weekly to reflect any new badges....
This scenario would become much easier if there was a route that accepts the id from the badge table and would render the specific badge for the user. Something like this:
http://stackoverflow/badge/1367877
Does such route maybe already exist but is it not yet revealed? If this doesn't exist can this be considered to be added? Or add the master-badgeid to the badge table? Either solution will work and enable us to render a working link from SEDE for badges.
Until this is implemented we can use some javascript to get the badges from the StackAPI as shown here.
There are two requests (1,2) that ask for different behavior of the badge url but they don't solve this problem. My request doesn't invalidate those request.