Tic Tac Toe WebSocket API 1.0.0

This API allows real-time interaction in a Tic Tac Toe game via WebSockets.

Contact link: masechkacat Contact email: masechkacat@gmail.com

Servers

ws://localhost:3000 ws

Local development server for Tic Tac Toe.

Operations

Pub /

Send moves to the server.

Accepts the following message:

Payload
object
index
integer
>= 0 <= 8

Additional properties are allowed.

Examples

Move
Payload
{
  "index": 0
}
This example has been generated automatically.

Sub /

Receive updates from the server, including game state and messages.

Accepts one of the following messages:

#1

Payload
object
result
object
status
string
Enum: "continue" "win" "draw"
board
array<string>

Items:

0
string
Enum: null "X" "O"

Additional items are allowed.

currentPlayer
string
playerIds
array<string>

Items:

0
string

Additional items are allowed.

Additional properties are allowed.

Additional properties are allowed.

#2

Payload
object
text
string

Additional properties are allowed.

#3

Payload
object
text
string

Additional properties are allowed.

#4

Payload
object
message
string

Additional properties are allowed.

Examples

GameUpdate
Payload
{
  "result": {
    "status": "continue",
    "board": [
      null
    ],
    "currentPlayer": "string",
    "playerIds": [
      "string"
    ]
  }
}
This example has been generated automatically.
Message
Payload
{
  "text": "string"
}
This example has been generated automatically.
GameOver
Payload
{
  "text": "string"
}
This example has been generated automatically.
Error
Payload
{
  "message": "string"
}
This example has been generated automatically.

Messages

#1

Payload
object
index
integer
>= 0 <= 8

Additional properties are allowed.

#2

Payload
object
result
object
status
string
Enum: "continue" "win" "draw"
board
array<string>

Items:

0
string
Enum: null "X" "O"

Additional items are allowed.

currentPlayer
string
playerIds
array<string>

Items:

0
string

Additional items are allowed.

Additional properties are allowed.

Additional properties are allowed.

#3

Payload
object
text
string

Additional properties are allowed.

#4

Payload
object
text
string

Additional properties are allowed.

#5

Payload
object
message
string

Additional properties are allowed.