A service which handles the configuration, execution and termination of chess games.
This API refers to the messages that can be exchanged during the connection between a player and a specific chess game.
Default Local Server
The websocket connection between a player and a chess game.
Interact with the chess game with the specified id.
the id of the chess game which the player is connected to.
Accepts one of the following messages:
Request the chess game to provide a snapshot of its state.
The state of a chess game contains information not only about the game itself,
but also about the server hosting the game. In particular, a ServerState
refers
to all the information of a chess game, including the state of the server, possible
errors, subscription and the state of the actual game, which it is referred to as
GameState
.
{
"methodCall": {
"method": "GetState"
}
}
Join the chess game as the specified player in the specified team.
{
"methodCall": {
"method": "JoinGame",
"input": {
"player": {
"team": "WHITE",
"name": "Paul"
}
}
}
}
Request the chess game to provide the available moves for the piece at the specified position.
{
"methodCall": {
"method": "FindMoves",
"input": {
"position": {
"file": "A",
"rank": "1"
}
}
}
}
Request the chess game to apply the specified move.
{
"methodCall": {
"method": "ApplyMove",
"input": {
"move": {
"from": {
"file": "A",
"rank": "2"
},
"to": {
"file": "A",
"rank": "3"
}
}
}
}
}
Request the chess game to promote the pawn which is currently awaiting for promotion to the specified promotion choice.
{
"methodCall": {
"method": "Promote",
"input": {
"promotionChoice": "Queen"
}
}
}
The websocket connection between a player and a chess game.
Observe the consequences of the interactions with the chess game with the specified id.
the id of the chess game which the player is connected to.
Accepts one of the following messages:
A response to the 'Get State' request from a player.
{
"methodCall": {
"method": "GetState",
"output": {
"serverState": {
"situation": "NotConfigured",
"subscriptions": [],
"error": null,
"gameState": {
"chessboard": {
"pieces": [
{
"piece": {
"type": "Rook",
"team": "WHITE"
},
"position": {
"file": "A",
"rank": "1"
}
},
{
"piece": {
"type": "Knight",
"team": "WHITE"
},
"position": {
"file": "B",
"rank": "1"
}
},
{
"piece": {
"type": "Bishop",
"team": "WHITE"
},
"position": {
"file": "C",
"rank": "1"
}
},
{
"piece": {
"type": "Queen",
"team": "WHITE"
},
"position": {
"file": "D",
"rank": "1"
}
},
{
"piece": {
"type": "King",
"team": "WHITE"
},
"position": {
"file": "E",
"rank": "1"
}
},
{
"piece": {
"type": "Bishop",
"team": "WHITE"
},
"position": {
"file": "F",
"rank": "1"
}
},
{
"piece": {
"type": "Knight",
"team": "WHITE"
},
"position": {
"file": "G",
"rank": "1"
}
},
{
"piece": {
"type": "Rook",
"team": "WHITE"
},
"position": {
"file": "H",
"rank": "1"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "A",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "B",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "C",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "D",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "E",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "F",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "G",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "H",
"rank": "2"
}
},
{
"piece": {
"type": "Rook",
"team": "BLACK"
},
"position": {
"file": "A",
"rank": "8"
}
},
{
"piece": {
"type": "Knight",
"team": "BLACK"
},
"position": {
"file": "B",
"rank": "8"
}
},
{
"piece": {
"type": "Bishop",
"team": "BLACK"
},
"position": {
"file": "C",
"rank": "8"
}
},
{
"piece": {
"type": "Queen",
"team": "BLACK"
},
"position": {
"file": "D",
"rank": "8"
}
},
{
"piece": {
"type": "King",
"team": "BLACK"
},
"position": {
"file": "E",
"rank": "8"
}
},
{
"piece": {
"type": "Bishop",
"team": "BLACK"
},
"position": {
"file": "F",
"rank": "8"
}
},
{
"piece": {
"type": "Knight",
"team": "BLACK"
},
"position": {
"file": "G",
"rank": "8"
}
},
{
"piece": {
"type": "Rook",
"team": "BLACK"
},
"position": {
"file": "H",
"rank": "8"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "A",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "B",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "C",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "D",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "E",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "F",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "G",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "H",
"rank": "7"
}
}
]
},
"moveHistory": {
"entries": []
},
"currentTurn": "WHITE",
"configuration": {
"timeConstraint": {
"type": "NoLimit"
},
"whitePlayer": {
"team": "WHITE",
"name": ""
},
"blackPlayer": {
"team": "BLACK",
"name": ""
},
"gameMode": "PVP",
"isPrivate": false,
"gameId": null
},
"situation": {
"type": "None"
},
"gameOver": null,
"timers": {
"white": null,
"black": null
}
}
}
}
}
}
{
"methodCall": {
"method": "GetState",
"output": {
"serverState": {
"situation": "Ready",
"subscriptions": [],
"error": null,
"gameState": {
"chessboard": {
"pieces": [
{
"piece": {
"type": "Rook",
"team": "WHITE"
},
"position": {
"file": "A",
"rank": "1"
}
},
{
"piece": {
"type": "Knight",
"team": "WHITE"
},
"position": {
"file": "B",
"rank": "1"
}
},
{
"piece": {
"type": "Bishop",
"team": "WHITE"
},
"position": {
"file": "C",
"rank": "1"
}
},
{
"piece": {
"type": "Queen",
"team": "WHITE"
},
"position": {
"file": "D",
"rank": "1"
}
},
{
"piece": {
"type": "King",
"team": "WHITE"
},
"position": {
"file": "E",
"rank": "1"
}
},
{
"piece": {
"type": "Bishop",
"team": "WHITE"
},
"position": {
"file": "F",
"rank": "1"
}
},
{
"piece": {
"type": "Knight",
"team": "WHITE"
},
"position": {
"file": "G",
"rank": "1"
}
},
{
"piece": {
"type": "Rook",
"team": "WHITE"
},
"position": {
"file": "H",
"rank": "1"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "A",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "B",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "C",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "D",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "E",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "F",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "G",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "H",
"rank": "2"
}
},
{
"piece": {
"type": "Rook",
"team": "BLACK"
},
"position": {
"file": "A",
"rank": "8"
}
},
{
"piece": {
"type": "Knight",
"team": "BLACK"
},
"position": {
"file": "B",
"rank": "8"
}
},
{
"piece": {
"type": "Bishop",
"team": "BLACK"
},
"position": {
"file": "C",
"rank": "8"
}
},
{
"piece": {
"type": "Queen",
"team": "BLACK"
},
"position": {
"file": "D",
"rank": "8"
}
},
{
"piece": {
"type": "King",
"team": "BLACK"
},
"position": {
"file": "E",
"rank": "8"
}
},
{
"piece": {
"type": "Bishop",
"team": "BLACK"
},
"position": {
"file": "F",
"rank": "8"
}
},
{
"piece": {
"type": "Knight",
"team": "BLACK"
},
"position": {
"file": "G",
"rank": "8"
}
},
{
"piece": {
"type": "Rook",
"team": "BLACK"
},
"position": {
"file": "H",
"rank": "8"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "A",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "B",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "C",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "D",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "E",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "F",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "G",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "H",
"rank": "7"
}
}
]
},
"moveHistory": {
"entries": []
},
"currentTurn": "WHITE",
"configuration": {
"timeConstraint": {
"type": "MoveLimit",
"time": {
"value": {
"$numberLong": "5"
},
"unit": "MINUTES"
}
},
"whitePlayer": {
"team": "WHITE",
"name": "Paul"
},
"blackPlayer": {
"team": "BLACK",
"name": "George"
},
"gameMode": "PVP",
"isPrivate": false,
"gameId": "PaulPrivateGame"
},
"situation": {
"type": "None"
},
"gameOver": null,
"timers": {
"white": null,
"black": null
}
}
}
}
}
}
A response to the 'Join Game' request from a player.
{
"methodCall": {
"method": "JoinGame"
}
}
A response to the 'Find Moves' request from a player.
{
"methodCall": {
"method": "FindMoves",
"output": {
"moves": [
{
"from": {
"file": "A",
"rank": "2"
},
"to": {
"file": "A",
"rank": "3"
}
},
{
"from": {
"file": "A",
"rank": "2"
},
"to": {
"file": "A",
"rank": "4"
}
}
]
}
}
}
A response to the 'Apply Move' request from a player.
{
"methodCall": {
"method": "ApplyMove"
}
}
A response to the 'Promote' request from a player.
{
"methodCall": {
"method": "Promote"
}
}
An event triggered when the chessboard of the game is updated.
{
"event": {
"type": "ChessboardUpdateEvent",
"payload": {
"pieces": [
{
"piece": {
"type": "Rook",
"team": "WHITE"
},
"position": {
"file": "A",
"rank": "1"
}
},
{
"piece": {
"type": "Knight",
"team": "WHITE"
},
"position": {
"file": "B",
"rank": "1"
}
},
{
"piece": {
"type": "Bishop",
"team": "WHITE"
},
"position": {
"file": "C",
"rank": "1"
}
},
{
"piece": {
"type": "Queen",
"team": "WHITE"
},
"position": {
"file": "D",
"rank": "1"
}
},
{
"piece": {
"type": "King",
"team": "WHITE"
},
"position": {
"file": "E",
"rank": "1"
}
},
{
"piece": {
"type": "Bishop",
"team": "WHITE"
},
"position": {
"file": "F",
"rank": "1"
}
},
{
"piece": {
"type": "Knight",
"team": "WHITE"
},
"position": {
"file": "G",
"rank": "1"
}
},
{
"piece": {
"type": "Rook",
"team": "WHITE"
},
"position": {
"file": "H",
"rank": "1"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "A",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "B",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "C",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "D",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "E",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "F",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "G",
"rank": "2"
}
},
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"position": {
"file": "H",
"rank": "2"
}
},
{
"piece": {
"type": "Rook",
"team": "BLACK"
},
"position": {
"file": "A",
"rank": "8"
}
},
{
"piece": {
"type": "Knight",
"team": "BLACK"
},
"position": {
"file": "B",
"rank": "8"
}
},
{
"piece": {
"type": "Bishop",
"team": "BLACK"
},
"position": {
"file": "C",
"rank": "8"
}
},
{
"piece": {
"type": "Queen",
"team": "BLACK"
},
"position": {
"file": "D",
"rank": "8"
}
},
{
"piece": {
"type": "King",
"team": "BLACK"
},
"position": {
"file": "E",
"rank": "8"
}
},
{
"piece": {
"type": "Bishop",
"team": "BLACK"
},
"position": {
"file": "F",
"rank": "8"
}
},
{
"piece": {
"type": "Knight",
"team": "BLACK"
},
"position": {
"file": "G",
"rank": "8"
}
},
{
"piece": {
"type": "Rook",
"team": "BLACK"
},
"position": {
"file": "H",
"rank": "8"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "A",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "B",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "C",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "D",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "E",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "F",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "G",
"rank": "7"
}
},
{
"piece": {
"type": "Pawn",
"team": "BLACK"
},
"position": {
"file": "H",
"rank": "7"
}
}
]
}
}
}
An event triggered when the game over status of the game is updated.
The game over status of game, if present, tells that the game has ended and gives information about the result of the game, such as the cause of the game over and the winner of the game (if any).
{
"event": {
"type": "GameOverUpdateEvent",
"payload": {
"cause": "Checkmate",
"winner": {
"team": "WHITE",
"name": "Paul"
}
}
}
}
An event triggered when the situation of the game is updated.
{
"event": {
"type": "GameSituationUpdateEvent",
"payload": {
"type": "None"
}
}
}
An event triggered when the history of the moves executed in the game is updated.
{
"event": {
"type": "MoveHistoryUpdateEvent",
"payload": {
"entries": [
{
"piece": {
"type": "Pawn",
"team": "WHITE"
},
"move": {
"from": {
"file": "A",
"rank": "1"
},
"to": {
"file": "A",
"rank": "2"
}
}
},
{
"piece": {
"type": "Knight",
"team": "BLACK"
},
"move": {
"from": {
"file": "G",
"rank": "8"
},
"to": {
"file": "H",
"rank": "6"
}
}
}
]
}
}
}
An event triggered when the white player in the game is updated.
{
"event": {
"type": "WhitePlayerUpdateEvent",
"payload": {
"team": "WHITE",
"name": "Paul"
}
}
}
An event triggered when the black player in the game is updated.
{
"event": {
"type": "BlackPlayerUpdateEvent",
"payload": {
"team": "BLACK",
"name": "George"
}
}
}
An event triggered when the timer of the white player in the game is updated.
{
"event": {
"type": "WhiteTimerUpdateEvent",
"payload": {
"value": {
"$numberLong": "5"
},
"unit": "MINUTES"
}
}
}
An event triggered when the timer of the black player in the game is updated.
{
"event": {
"type": "BlackTimerUpdateEvent",
"payload": {
"value": {
"$numberLong": "5"
},
"unit": "MINUTES"
}
}
}
An event triggered when the current turn in the game is updated.
{
"event": {
"type": "TurnUpdateEvent",
"payload": "WHITE"
}
}
An event triggered when the latest error thrown by the server hosting the chess game is updated.
An error during a chess game can be one of the following:
{
"event": {
"type": "ServerErrorUpdateEvent",
"payload": {
"type": "GameAlreadyStartedException",
"message": "string"
}
}
}
An event triggered when the situation of the server hosting the chess game is updated.
The situation of a server hosting a chess game can be one of the following:
{
"event": {
"type": "ServerSituationUpdateEvent",
"payload": "Running"
}
}
An event triggered when the subscriptions to the events generated by the game are updated.
{
"event": {
"type": "SubscriptionUpdateEvent",
"payload": [
"1bs22c3e2daj0"
]
}
}
Request the chess game to provide a snapshot of its state.
The state of a chess game contains information not only about the game itself,
but also about the server hosting the game. In particular, a ServerState
refers
to all the information of a chess game, including the state of the server, possible
errors, subscription and the state of the actual game, which it is referred to as
GameState
.
Join the chess game as the specified player in the specified team.
Request the chess game to provide the available moves for the piece at the specified position.
Request the chess game to apply the specified move.
Request the chess game to promote the pawn which is currently awaiting for promotion to the specified promotion choice.
A response to the 'Get State' request from a player.
A response to the 'Join Game' request from a player.
A response to the 'Find Moves' request from a player.
A response to the 'Apply Move' request from a player.
A response to the 'Promote' request from a player.
An event triggered when the chessboard of the game is updated.
An event triggered when the game over status of the game is updated.
The game over status of game, if present, tells that the game has ended and gives information about the result of the game, such as the cause of the game over and the winner of the game (if any).
An event triggered when the situation of the game is updated.
An event triggered when the history of the moves executed in the game is updated.
An event triggered when the white player in the game is updated.
An event triggered when the black player in the game is updated.
An event triggered when the timer of the white player in the game is updated.
An event triggered when the timer of the black player in the game is updated.
An event triggered when the current turn in the game is updated.
An event triggered when the latest error thrown by the server hosting the chess game is updated.
An error during a chess game can be one of the following:
An event triggered when the situation of the server hosting the chess game is updated.
The situation of a server hosting a chess game can be one of the following:
An event triggered when the subscriptions to the events generated by the game are updated.