REST API
JSON over HTTP. Field names are camelCase, and the types live in AcidBoy.Online.Contracts
(Dtos.cs). Endpoints marked need Authorization: Bearer <access token>; without one they
answer 401, and for a banned account 401 as well.
Authentication
Section titled “Authentication”| Method and path | Body | Answer |
|---|---|---|
GET /auth/providers |
— | [ProviderDto] (id, name) of the enabled sign-ins, including dev when enabled |
GET /auth/{provider}/start?redirect_uri&code_challenge&state |
— | Redirect to the provider. 400 if the redirect isn’t loopback or the challenge is missing; 404 for a disabled provider |
GET /auth/callback/{provider} |
— | Used by the provider |
GET /auth/complete |
— | Redirect to the loopback URI with code and state |
POST /auth/token |
TokenRequest (code, codeVerifier) |
TokenResponse; 401 bad code or verifier; 403 banned |
POST /auth/dev |
DevLoginRequest (name) |
TokenResponse; 404 when disabled; 403 banned |
POST /auth/refresh |
RefreshRequest (refreshToken) |
TokenResponse with a new refresh token; 401 invalid or expired; 403 banned |
POST /auth/logout |
RefreshRequest |
204 |
GET /me |
— | AccountDto (id, displayName, avatarUrl) |
TokenResponse: accessToken, accessTokenExpires, refreshToken, account. Refusals with a
reason use ErrorResponse (error).
Matches and results
Section titled “Matches and results”| Method and path | Body | Answer |
|---|---|---|
GET /me/matches?page=0 |
— | [MatchSummaryDto], 20 per page, newest first |
GET /me/matches/{id} |
— | MatchDetailDto; 404 unless you played in it |
POST /matches/{id}/results |
ReportResultRequest (sequence, kind, payload) |
204; 400 invalid (payload must be a JSON object ≤ 4 KB); 403 not a player; 404; 409 already reported, or both created the row at once (retry) |
GET /me/records |
— | [PlayerRecordDto]: wins, losses, draws, rounds per game |
GET /leaderboards |
— | [LeaderboardGameDto] (gameKey, gameName, players) |
GET /leaderboards/{gameKey}?top=50 |
— | LeaderboardDto with up to 100 ranked entries |
MatchSummaryDto, from the viewer’s side:
| Field | Meaning |
|---|---|
matchId |
|
opponent |
|
wasHost |
Whether you were the host |
gameTitle, opponentGameTitle |
|
startedAt, endedAt, endReason |
Clean, Disconnect, Timeout, NeverConnected, Error, Moderated |
results |
Each with sequence, kind, payload, verified |
gameKey |
|
outcome |
Undecided, Won, Lost, Draw |
wins, losses, draws |
Verified rounds |
MatchDetailDto adds:
hostandguest;- both ROM SHA-1s;
connectedAt;endedBy;bytesRelayed.
Result kinds and payloads are described in Win detection; how they decide a match in Data model.
Friends and players
Section titled “Friends and players”| Method and path | Answer |
|---|---|
GET /me/friends |
[FriendDto]: account, status (Pending/Accepted), incoming, presence (Offline/Online/InMatch) |
POST /me/friends/{accountId} |
Sends a request, or accepts theirs: "Requested", "Accepted" or "AlreadyFriends"; 404; 400 for yourself or over 200 friends and requests |
DELETE /me/friends/{accountId} |
Removes a friend, declines or withdraws a request; 204 or 404 |
GET /accounts?name= |
Up to 20 accounts whose name contains the text (at least 2 characters) |
Friend changes are also pushed through the lobby hub (FriendUpdated, PresenceChanged).
| Path | |
|---|---|
GET / |
AcidBoy server (health check) |
/hubs/lobby |
Lobby hub |
/relay/{matchId}?ticket= |
Link relay |
/admin/... |
Admin dashboard |
