This documentation is automatically generated.
Output schemas only represent data
and not the full output; see output examples and the JSend specification.
Content-Type: application/json
Input Schema
{
"required": [
"username",
"password"
],
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
}
}
}
Output Schema
{
"type": "object",
"properties": {
"username": {
"type": "string"
}
}
}
Notes
POST the required credentials to get back a cookie
username
: Usernamepassword
: Password
Input Schema
null
Output Schema
{
"type": "string"
}
Notes
GET to check if authenticated.
Should be obvious from status code (403 vs. 200).
Content-Type: application/json
Input Schema
null
Output Schema
{
"type": "string"
}
Notes
DELETE to clear cookie for current user.
Content-Type: application/json
Input Schema
{
"required": [
"nbpp"
],
"type": "object",
"properties": {
"nbpp": {
"type": "number"
}
}
}
Output Schema
{
"type": "object",
"properties": {
"game_id": {
"type": "string"
}
}
}
Notes
POST the required parameter to create a new game; only the owner of a room can make this request
nbpp
: Number of balls per player
Content-Type: application/json
Input Schema
null
Output Schema
{
"type": "string"
}
Output Example
"Game 12345678910 was completed; Guy was the winner."
Notes
DELETE to end the game; this endpoint should only be triggered if GameState indicates there is a winner.
Content-Type: application/json
Input Schema
null
Output Schema
{
"type": "object",
"properties": {
"winner": {
"type": [
"string",
"null"
]
},
"balls_on_table": {
"type": "array"
}
}
}
Output Example
{
"winner": "Guy",
"balls_on_table": [
2,
5,
9,
6
]
}
Notes
GET to receive state of current_game
winner
: Potential winner of the game, or empty string
balls_on_table
: Array of balls still on the table
Content-Type: application/json
Input Schema
null
Output Schema
{
"required": [
"game_id"
],
"type": "object",
"properties": {
"game_id": {
"type": "string"
}
}
}
Notes
DELETE to remove yourself from current game
Content-Type: application/json
Input Schema
null
Output Schema
{
"required": [
"gamemaster",
"players"
],
"type": "object",
"properties": {
"players": {
"type": "array"
},
"gamemaster": {
"type": [
"string",
"null"
]
}
}
}
Output Example
{
"players": [
"Stark",
"Stannis",
"Baratheon",
"Tyrell",
"Lannister"
],
"gamemaster": "Stark"
}
Notes
GET to receive list of players in current game
players
array includes ALL players (including gamemaster)gamemaster
field is useful for highlighting the gamemaster in the UI
Content-Type: application/json
Input Schema
{
"required": [
"ball"
],
"type": "object",
"properties": {
"ball": {
"type": "number"
}
}
}
Output Schema
{
"required": [
"game_id"
],
"type": "object",
"properties": {
"game_id": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
Notes
POST the required parameters to register the pocketing/unpocketing of a ball
ball
: The ball that was pocketed/unpocketed
Content-Type: application/json
Input Schema
{
"required": [
"username",
"password"
],
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
}
}
}
Output Schema
{
"type": "object",
"properties": {
"username": {
"type": "string"
}
}
}
Notes
POST the required parameters to permanently register a new player
username
: Username of the playerpassword
: Password for future logins
Input Schema
null
Output Schema
{
"type": "object",
"properties": {
"current_room": {
"type": "string"
},
"orig_balls": {
"type": "array"
},
"current_game_id": {
"type": "string"
},
"name": {
"type": "string"
},
"balls": {
"type": "array"
}
}
}
Notes
GET to retrieve player info
Content-Type: application/json
Input Schema
{
"required": [
"roomname"
],
"type": "object",
"properties": {
"roomname": {
"type": "string"
},
"password": {
"type": "string"
}
}
}
Output Schema
{
"type": "object",
"properties": {
"roomname": {
"type": "string"
}
}
}
Notes
POST the required parameters to create a new room
name
: Name of the roompassword
: (Optional) Password to the room if you wish to keep entry restricted to players who know the password
Content-Type: application/json
Input Schema
{
"required": [
"name"
],
"type": "object",
"properties": {
"password": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
Output Schema
{
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
Notes
POST the required parameters to create a new room
name
: Name of the roompassword
: (Optional) Password to the room if it has one
Content-Type: application/json
Input Schema
null
Output Schema
{
"type": "string"
}
Notes
DELETE to leave current room. If the room owner leaves, the room will be deleted.
Content-Type: application/json
Input Schema
null
Output Schema
{
"required": [
"owner",
"players"
],
"type": "object",
"properties": {
"owner": {
"type": "string"
},
"players": {
"type": "array"
}
}
}
Output Example
{
"owner": "Stark",
"players": [
"Stark",
"Stannis",
"Baratheon",
"Tyrell",
"Lannister"
]
}
Notes
GET to receive list of players in current room
players
array includes ALL players (including owner)owner
field is useful for highlighting the room owner in the UI
Content-Type: application/json
Input Schema
null
Output Schema
{
"type": "array"
}
Output Example
[
{
"pwd_req": true,
"name": "Curve"
},
{
"pwd_req": false,
"name": "Cue"
}
]
Notes
GET to receive list of rooms