Skip to content

API Specification

Lilith edited this page Jul 3, 2023 · 34 revisions

End Points

WIP all contents of this page are subject to change.

Current API version: v1 (all current endpoints will of the form mac/<endpoint>/v1)

Do:


game

Endpoint URL: mac/game/v1

GET

Payload:

{}

No payload required. This endpoint should be hit every time the player joins a new lobby/game. To update a lobby, use mac/user/v# instead.

Response:

"server": {
  "players": [
    "76561198210264393": {
      "isSelf": false,
      "name": "x",
      "steamInfo": {
        "accountName": "x",
        "pfp": "x",
        "steamID": "x",
        "vacBans": "x",
        //...Any Other info you can find
      },
      "gameInfo": {
        "team": "RED"
        "ping": 64,
        "kills": 0,
        "deaths": 0,
        //...
      },
      "localVerdict": "Cheater",
      "databaseVerdict": "Suspicious",
    },
    {
      //....
    }
  ],
  "map": "X",
  "ip": "X",
  "maxPlayers": 32,
  "players": 17,
  "gamemode": {
    "matchmaking": false,
    "type": "Arena",
    "vanilla": false
  }
}

Response contains server data, game details such as map, IP and gamemode, and a list of every player in the game (including self)

user

Endpoint URL: mac/user/v1

GET

Payload:

{
  "steamID64": ["xyz", "abc"],
  "name": ["foo", "bar"]
}

The payload shall consist of a list of steamID64 values OR a list of in-game names of players to fetch. Either may be null or the empty list.

Response:

{
  "players": [
    "abc": {
      "isSelf": false,
      "name": "x",
      "steamInfo": {
        "accountName": "x",
        "pfp": "x",
        "steamID": "x",
        "vacBans": "x",
        //...Any Other info you can find
      },
      "gameInfo": {
        "team": "RED"
        "ping": 64,
        "kills": 0,
        "deaths": 0,
        //...
      },
      "localVerdict": "Cheater",
      "databaseVerdict": "Suspicious",
    },
    {
      "isSelf": false,
      "name": "foo",
      //....
    }
  ],
  "errors": {
    "xyz": "Player not found in game.",
    "bar": "Player not found in game."
  },
}

The response shall contain a players object for each player that was both provided in the payload, and found in the game. And an errors object for each player that the back-end could not return a players object for

POST

Payload:

{
  "<steamID64>": {
    "localVerdict": "abc"
  } 
}

The payload shall contain a key-object pair where the key is the steamID64 of a desired user, and the object contains a single element, a key-value pair of "verdict": < verdict string >. This updates the back-end entry for the verdict of that player (defined by the steamID64).

Response:

{
  "errors": {}
}

The response shall contain an errors object that would detail any errors encountered whilst trying to update the specified players stored data.

Clone this wiki locally