Skip to content
moxon home

Tic-Tac-Toe Fetch

The /tic-tac-toe/fetch endpoint retrieves information about a current Tic-Tac-Toe game.

posthttps://api.moxon.dev/v3/tic-tac-toe/fetch

Parameters

  • usernamestringrequired

    The username of the player

  • gamestringoptional

    The game identifier to fetch

  • privatestringoptional

    Set to true to fetch only private games

Request Example

Request
curl -X POST -d "username=User1&game=VWXYZ" "https://api.moxon.dev/v3/tic-tac-toe/fetch"

Response

Response
{
    "game": "VWXYZ",
    "players": ["User1", "User2"],
    "board": [
        ["X", "", "O"],
        ["", "X", ""],
        ["O", "", ""]
    ],
    "current_turn": "User2",
    "status": "in_progress",
    "private": false,
    "created_at": "2025-01-21T10:30:00.000Z"
}

Response Fields

FieldDescription
gameGame identifier
playersArray of player usernames
board3x3 array representing the game board
current_turnUsername of the player whose turn it is
statusGame status (waiting, in_progress, finished)
privateWhether the game is private
created_atGame creation timestamp

Error Handling

If parameters are missing or invalid, the API will return an error:

  • 400Please provide a username (?username={username})The username parameter is missing