Skip to content

Dimensions Station API

Stone Tao edited this page Oct 31, 2020 · 14 revisions

This is the API that is served automatically upon creation of a Dimension. It serves data on ongoing matches, tournaments and allows you to also directly control these matches and tournaments through the API.

Typically, the API will be served at http://localhost:9000. Watch your logs to see if this is not the case (it may be that 9000 is busy and the station is served at 9001 instead)

Dimensions

Route: /api/dimensions

  • GET: Returns all observed dimensions

Route: /api/dimensions/:dimensionID

  • GET: Returns all data of the dimension instance with id dimensionID

Matches

Route: /api/dimensions/:dimensionID/match

  • GET: Retrieve all matches created and ran using dimension.createMatch or dimension.runMatch where dimension is the dimension instance with id dimensionID

Route: /api/dimensions/:dimensionID/match/:matchID

  • GET: Retrieve all data of the match instance with id matchID in dimension with id dimensionID
  • DELETE: Deletes the match forever

Route: /api/dimensions/:dimensionID/match/:matchID/results

  • GET: Retrieve the results of the match instance with id matchID in dimension with id dimensionID

Route: /api/dimensions/:dimensionID/match/:matchID/run

  • POST: Runs the match with id matchID if it is finished, currently stopped, or not running at the moment

Route: /api/dimensions/:dimensionID/match/:matchID/stop

  • POST: Stops the match with id matchID if it currently running

Tournaments

Route: /api/dimensions/:dimensionID/tournaments

  • GET: Retrieve all tournaments created using dimension.createTournament where dimension is the dimension instance with id dimensionID

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID

  • GET: Retrieve status, state, competitors, name, configs data fields of the tournament instance with id tournamentID in dimension with id dimensionID

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/match-queue

  • GET: Retrieve the current matchQueue of the tournament instance with id tournamentID as an array
  • POST: Queue a new match by providing matchQueue field in body, containing a list of array elements. Each array element is a list of string player Ids identifying the players to match up in a match.

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/match

  • GET: Retrieve the ongoing matches of the tournament instance with id tournamentID

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/match/:matchID

  • GET: Retrieves match with id matchID in the tournament
  • DELETE: Deletes the match with id matchID. This operation will result in a FatalError if the tournament type is RoundRobin or Elimination.

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/match/:matchID/replay

  • GET: Retrieves match replay with id matchID in the tournament

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/ranks

  • GET: Retrieves the current rankings and rank states of all competitors in the tournament instance with id tournamentID Can provide query params limit and offset

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/run

  • POST: Runs/resumes the tournament with id tournamentID if it is not running at the moment

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/stop

  • POST: Stops the tournament with id tournamentID if it is currently running at the moment

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/configs

  • POST: Post new configurations for the tournament to use. These configurations are automatically populated to all other tournament instances with the same id provided they have syncConfigs turned on and there's a database being used.

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/reset

  • POST: Resets the rankings of the tournament. Requires the tournament to be stopped first.

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/match/players/:playerID

  • GET : Retrieves all data relevant to player with id playerID in the tournament.

Route: /api/dimensions/:dimensionID/tournaments/:tournamentID/match/players/:playerID/match

  • GET : Retrieves past matches for player. Query params are limit, offset, and order of which order is by finish date of matches