A documentation repository for frantic. Contains REST and WebSocket API.
get list of lobbies
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
q | query | filter lobby names or creators | No | string |
Code | Description |
---|---|
200 | list of lobbies |
create a lobby from username
Code | Description |
---|---|
201 | lobby created |
400 | Bad request. Request body is missing or invalid. |
join a lobby with username
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
id | path | Yes | integer |
Code | Description |
---|---|
201 | OK. Username added to lobby. |
400 | Bad request. Request body is missing or invalid. |
403 | Forbidden. Lobby is private. |
404 | Lobby not found. |
409 | Username already exists on this server. |
Register Connection
Name | Type |
---|---|
token | string |
{
"token": "123-abc-456-def"
}
Player Registered Successfully
Name | Type |
---|---|
username | string |
lobbyId | string |
{
"username": "user1",
"lobbyId": "1"
}
Set Lobby Settings
Name | Type |
---|---|
lobbyName | string |
gameDuration | string |
turnDuration | string |
publicLobby | boolean |
{
"lobbyName": "kyrill's lobby",
"gameDuration": "medium",
"turnDuration": "normal",
"publicLobby": "false"
}
Update Lobby
Name | Type |
---|---|
players | array |
players.username | string |
players.admin | boolean |
settings | object |
settings.lobbyName | string |
settings.gameDuration | string |
settings.gameDurationItems | array |
settings.gameDurationItems.name | string |
settings.gameDurationItems.value | string |
settings.turnDuration | string |
settings.turnDurationItems | array |
settings.turnDurationItems.name | string |
settings.turnDurationItems.value | string |
settings.publicLobby | boolean |
{
"players": [
{
"username": "kyrill",
"admin": false
}
],
"settings": {
"lobbyName": "kyrill's lobby",
"gameDuration": "medium",
"gameDurationItems": [
{
"name": "Short",
"value": "short"
}
],
"turnDuration": "normal",
"turnDurationItems": [
{
"name": "Normal",
"value": "normal"
}
],
"publicLobby": true
}
}
Kick Player
Name | Type |
---|---|
username | string |
{
"username": "kyrill"
}
Disconnect Player
Name | Type |
---|---|
reason | string |
{
"reason": "Lobby was closed"
}
Send Message
Name | Type |
---|---|
message | string |
{
"message": "I'm ready"
}
Update Chat
Name | Type |
---|---|
type | string |
username | string |
icon | string |
message | string |
{
"type": "msg",
"username": "kyrill",
"icon": "avatar:kyrill",
"message": "I'm ready"
}
Start Game
Name | Type |
---|---|
Message Payload | object |
{}
Start Game
Name | Type |
---|---|
Message Payload | object |
{}
Start Game Round
Name | Type |
---|---|
Message Payload | object |
{}
Game State
Name | Type |
---|---|
discardPile | object |
discardPile.type | string |
discardPile.value | string |
discardPile.color | string |
discardPile.key | integer |
players | array |
players.username | string |
players.points | integer |
players.cards | array |
players.cards.type | string |
players.skipped | boolean |
players.admin | boolean |
{
"discardPile": {
"type": "number",
"value": "1",
"color": "red",
"key": 35
},
"players": [
{
"username": "kyrill",
"points": 12,
"cards": [
{
"type": "back"
}
],
"skipped": false,
"admin": true
}
]
}
Hand
Name | Type |
---|---|
cards | array |
cards.type | string |
cards.value | string |
cards.color | string |
cards.key | integer |
{
"cards": [
{
"type": "number",
"value": "3",
"color": "red",
"key": 35
},
{
"type": "special",
"value": "fuck-you",
"color": "multicolor",
"key": 48
}
]
}
Playable
Name | Type |
---|---|
cards | array |
canDraw | boolean |
canEnd | boolean |
{
"cards": [
3,
5
],
"canDraw": true,
"canEnd": false
}
Timer
Name | Type |
---|---|
seconds | integer |
{
"seconds": 30
}
Animation Speed
Name | Type |
---|---|
hand | integer |
{
"hand": 0
}
Start Turn
Name | Type |
---|---|
currentPlayer | string |
timebombRounds | integer |
{
"currentPlayer": "Kyrill",
"timebombRounds": 3
}
Play Card
Name | Type |
---|---|
index | integer |
{
"index": 3
}
Response to Action Card
Name | Type |
---|---|
action | string |
{
"action": "gift"
}
Gift
Name | Type |
---|---|
cards | array |
target | string |
{
"cards": [
3,
5
],
"target": "kyrill"
}
Exchange
Name | Type |
---|---|
cards | array |
target | string |
{
"cards": [
3,
5
],
"target": "kyrill"
}
Skip
Name | Type |
---|---|
target | string |
{
"target": "kyrill"
}
Fantastic
Accepts one of the following messages:
Name | Type |
---|---|
number | integer |
{
"number": 3
}
Name | Type |
---|---|
color | string |
{
"color": "red"
}
Fantastic Four
Accepts one of the following messages:
Name | Type |
---|---|
targets | object |
number | integer |
{
"targets": {
"kyrill": 1,
"remy": 3
},
"number": 3
}
Name | Type |
---|---|
targets | object |
color | string |
{
"targets": {
"kyrill": 1,
"remy": 3
},
"color": "red"
}
Counter Attack / Nice Try Opportunity
Name | Type |
---|---|
time | integer |
playable | array |
{
"time": 5,
"playable": [
3,
5
]
}
Counter Attack Turn
Name | Type |
---|---|
currentPlayer | string |
{
"currentPlayer": "Kyrill"
}
Counter Attack
Name | Type |
---|---|
color | string |
{
"color": "red"
}
Nice Try
Name | Type |
---|---|
color | string |
{
"color": "red"
}
Equality
Name | Type |
---|---|
target | string |
color | string |
{
"target": "kyrill",
"color": "red"
}
Event Happens
Name | Type |
---|---|
event | string |
message | string |
{
"event": "tornado",
"message": "All cards in the hands of the players…"
}
Surprise Party
Name | Type |
---|---|
card | integer |
target | string |
{
"card": 3,
"target": "kyrill"
}
Merry Christmas
Name | Type |
---|---|
targets | array |
{
"targets": [
{
"kyrill": [
3,
5
]
}
]
}
Gambling Man Selection
Name | Type |
---|---|
playable | array |
{
"playable": [
3,
5
]
}
Recession Amount
Name | Type |
---|---|
amount | integer |
{
"amount": 2
}
Recession
Name | Type |
---|---|
cards | array |
{
"cards": [
3,
5
]
}
Market Selection
Name | Type |
---|---|
cards | array |
cards.type | string |
cards.value | string |
cards.color | string |
cards.key | integer |
{
"cards": [
{
"type": "number",
"value": "3",
"color": "red",
"key": 35
},
{
"type": "special",
"value": "fuck-you",
"color": "multicolor",
"key": 48
}
]
}
Market
Name | Type |
---|---|
card | integer |
{
"card": 3
}
Draw Card
Name | Type |
---|---|
Message Payload | object |
{}
Draw Card Animation
Name | Type |
---|---|
amount | integer |
{
"amount": 5
}
End Turn
Name | Type |
---|---|
Message Payload | object |
{}
Game Round is Over
Name | Type |
---|---|
players | object |
changes | object |
admin | string |
pointLimit | integer |
icon | string |
message | string |
{
"players": {
"kyrill": 54,
"remy": 63
},
"changes": {
"kyrill": 12,
"remy": 14
},
"admin": "kyrill",
"pointLimit": 168,
"icon": "event:doomsday",
"message": "Doomday happened."
}
Game is Over
Name | Type |
---|---|
players | object |
{
"players": {
"kyrill": 120,
"remy": 80
}
}
Rematch
Name | Type |
---|---|
Message Payload | object |
{}
Reconnect
Name | Type |
---|---|
token | string |
{
"token": "abc-123-abc-123"
}