BZList API

Public API for BZList. GitHub

Note: the data structure is currently being revised, the information here may not be completely accurate.

Routes

The root for all routes is https://api.bzlist.net.

All routes may return code 500 with an error field.

If a route requires authentication, you must set the header Authorization to Bearer {token}. May result in a 401 Unauthorized response with an error field.

GET /

Documentation (this page).

Response Description
200 OK Returns the documentation in HTML

GET /status

Check if the server is online.

Response Description
200 OK Returns JSON object with online equal to true. Example: {online: true}

GET /servers

All online servers.

Response Description
200 OK Returns array of objects matching the server model.

GET /servers/:address/:port

Gets a specific server.

Response Description
200 OK Returns object matching the server model.

GET /players

All online players.

Response Description
200 OK Returns array of objects matching the player model.

POST /feedback

Submit feedback. Requires authentication.

Body

{
  "feedback": string
}
Response Description
200 OK Returns object with message field.

GET /users

Gets user info. Requires authentication.

Response Description
200 OK Returns object with callsign and bzid fields.
404 Not Found Returns object with error field.

DELETE /users

Deletes user. Requires authentication.

Response Description
200 OK Returns object with message field.

POST /users/token

Generates a token.

Body

{
  "callsign": string,
  "token": string
}
Response Description
200 OK Returns object with token field.
400 Bad Request Returns object with error field.

GET /users/token/renew

Generates a new token. Requires authentication.

Response Description
200 OK Returns object with token field.

GET /users/settings

Gets user settings. Requires authentication.

Response Description
200 OK Returns object with settings fields.
400 Bad Request Returns object with error field.

PATCH /users/settings

Updates user settings. Requires authentication.

Body

{
  "settingName": any,
  ...
}
Response Description
200 OK Returns object with message field.
400 Bad Request Returns object with error field.

Models

Server

{
  "address": string,
  "port": number,
  "ip": string,
  "owner": string,
  "country": string,
  "countryCode": string,
  "timestamp": number,
  "title": string,
  "teams": {
    "name": string,
    "players" number,
    "maxPlayers": number,
    "score": number
  }[],
  "players"?: Player[],
  "playersCount": number,
  "configuration": {
    "gameStyle": string,
    "maxShots": number,
    "maxPlayers": number,
    "superflags": boolean,
    "jumping": boolean,
    "ricochet": boolean,
    "inertia": boolean,
    "shaking": boolean,
    "noTeamKills": boolean,
    "dropBadFlags": {
      "wins": number,
      "losses": number
    }
  }
}

Player

{
  "callsign": string,
  "motto"?: string,
  "server"?: string,
  "timestamp"?: number,
  "team": string,
  "score": number,
}

CSS Licensed under MIT

Copyright © 2019-2020 The Noah