SDG Tic Tac Toe
SDG Tic Tac Toe
Version: 1.0.0
Access
[ Jump to Models ]
Table of Contents
Get the state of a current game (gameIdGet)
Retrieves the current state of a game
Path parameters
id (required)
Path Parameter — Game ID
Return type
Example data
Content-Type: application/json
{
"winner" : "X",
"id" : 42,
"board" : "[ [ \" \", \" \", \" \" ], [ \" \", \" \", \" \" ], [ \" \", \" \", \" \" ] ]\n"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Game Board
GameBoard
404
Game ID not found
Records a player's move (gameIdPost)
Supply the user's move and receive back a board with the user's and the computer's move
Path parameters
id (required)
Path Parameter — Game ID
Consumes
This API call consumes the following media types via the request header:
Request body
Return type
Example data
Content-Type: application/json
{
"winner" : "X",
"id" : 42,
"board" : "[ [ \" \", \" \", \" \" ], [ \" \", \" \", \" \" ], [ \" \", \" \", \" \" ] ]\n"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Game Board
GameBoard
400
User's move is invalid
404
Game ID not found
Creates a new Tic Tac Toe Game (gamePost)
This will setup a new game and return an initial board along with a game ID
Return type
Example data
Content-Type: application/json
{
"winner" : "X",
"id" : 42,
"board" : "[ [ \" \", \" \", \" \" ], [ \" \", \" \", \" \" ], [ \" \", \" \", \" \" ] ]\n"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
Game Board
GameBoard
[ Jump to Methods ]
Table of Contents
GameBoard
body
id (optional)
example: 42
winner (optional)
example: X
board (optional)
array[Object] 3x3 array of either a " " (no move), "X", or "O"
example: [ [ " ", " ", " " ], [ " ", " ", " " ], [ " ", " ", " " ] ]
row (optional)
Integer 0 based row index for player's move
column (optional)
Integer 0 based row index for player's move