99math.com apps protocol documentation
Local core http server
Local tbl websocket server
QA core server
Local development http domain for demo page
Production api server
Production socket.io server for live games
Accepts the following message:
login result
{
"success": true,
"data": {
"authToken": "string",
"userDataToken": "string"
}
}
Accepts the following message:
login with email and password api endpoint
data to login with email and password
{
"email": "string",
"password": "string",
"provider": "email"
}
Accepts the following message:
generated guest token result
{
"success": true,
"data": "string"
}
Accepts the following message:
request to generate guest auth token
Accepts the following message:
live game creation result
Accepts the following message:
creation live game
create new live game data
{
"gameType": {
"type": "string",
"equationType": "string",
"numberGenerator": {
"name": "string",
"primary": true,
"achievementLevel": "string",
"topic": "string",
"type": "string"
},
"cvcChallenge": {
"challengerGameCode": "string",
"challengeKey": "string"
},
"language": "string"
},
"requireLogin": true,
"round": {
"rounds": 0,
"roundDuration": 0
},
"demo": true,
"classCode": "string",
"metaData": {}
}
Available only on servers:
redis or mongo game code
Accepts one of the following messages:
result of checking join for GET request
{
"success": true,
"data": {
"canJoin": true,
"publicGame": true,
"requireLogin": true,
"metaData": {},
"code": "string",
"mode": "live"
}
}
connection data for POST requires
Available only on servers:
redis or mongo game code
Accepts one of the following messages:
GET request to check if it's possible to join game
POST request to join game
information about player joining game
{
"name": "string",
"joined": "2019-08-24T14:15:22Z",
"userId": "string",
"guestId": "string"
}
Available only on servers:
redis or mongo game code
Accepts the following message:
game info restuctured
game info compatible with v1 frontend
{
"userId": "string",
"creatorRole": "string",
"created": "2019-08-24T14:15:22Z",
"started": "2019-08-24T14:15:22Z",
"finished": "2019-08-24T14:15:22Z",
"demo": true,
"code": "string",
"type": "string",
"equationType": "string",
"numberGenerator": {
"name": "string",
"primary": true,
"achievementLevel": "string",
"topic": "string",
"type": "string"
},
"cvcChallenge": {
"challengerGameCode": "string",
"challengeKey": "string"
},
"language": "string",
"gameRounds": [],
"rounds": 0,
"roundDuration": 0,
"global": true,
"publicGame": true,
"publicGameSettings": {},
"classCode": "string",
"metaData": {}
}
Available only on servers:
redis or mongo game code
Accepts the following message:
game info request
Available only on servers:
redis or mongo game code
Accepts the following message:
game info restuctured
game info compatible with v1 frontend
{
"userId": "string",
"creatorRole": "string",
"created": "2019-08-24T14:15:22Z",
"started": "2019-08-24T14:15:22Z",
"finished": "2019-08-24T14:15:22Z",
"demo": true,
"code": "string",
"type": "string",
"equationType": "string",
"numberGenerator": {
"name": "string",
"primary": true,
"achievementLevel": "string",
"topic": "string",
"type": "string"
},
"cvcChallenge": {
"challengerGameCode": "string",
"challengeKey": "string"
},
"language": "string",
"gameRounds": [],
"rounds": 0,
"roundDuration": 0,
"global": true,
"publicGame": true,
"publicGameSettings": {},
"classCode": "string",
"metaData": {}
}
Available only on servers:
redis or mongo game code
Accepts the following message:
game info request
Available only on servers:
redis or mongo game code
Accepts the following message:
game info restuctured
[]
Available only on servers:
redis or mongo game code
Accepts the following message:
game info request
Available only on servers:
redis or mongo game code
Accepts the following message:
game info restuctured
[]
Available only on servers:
redis or mongo game code
Accepts the following message:
game info request
Available only on servers:
redis or mongo game code
Accepts the following message:
game info restuctured
{}
Available only on servers:
redis or mongo game code
Accepts the following message:
game info request
Accepts the following message:
timer sync message
date and time
2019-08-24T14:15:22Z
live game room channel
Available only on servers:
redis (join) game code
Accepts one of the following messages:
message fires if game by websocket token data not found
message with current game information
redis game
message on websocket connection, that game already finished
message to room about new player joined
player info
{
"name": "string",
"isConnected": true,
"userId": "string",
"guestId": "string",
"clientId": "string",
"avatar": "string",
"joined": "2019-08-24T14:15:22Z",
"kicked": "2019-08-24T14:15:22Z"
}
message to room about player disconnection
player info
{
"name": "string",
"isConnected": true,
"userId": "string",
"guestId": "string",
"clientId": "string",
"avatar": "string",
"joined": "2019-08-24T14:15:22Z",
"kicked": "2019-08-24T14:15:22Z"
}
message to room about player leaving
clientId of left player
string
message from host about conscous game leaving or to room about host leaving
message to room about next game round (questions only)
game round info
{
"started": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z",
"hasEnded": true,
"round": 0,
"rounds": 0
}
message to room about next game round start
{
"stats": {
"started": "2019-08-24T14:15:22Z",
"finished": "2019-08-24T14:15:22Z"
},
"roundData": {
"started": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z",
"gameCode": "string",
"round": 0,
"rounds": 0
}
}
message to room about finished and saved game mongo code
game code at mongo (permanent code)
string
message to room with current game leaderboard
game leaderboard
[
{
"name": "string",
"clientId": "string",
"avatar": "string",
"score": 0,
"correctAnswers": 0,
"wrongAnswers": 0,
"rounds": [],
"questions": [],
"highscore": {}
}
]
message to room about new player avatar
update information
{
"clientId": "string",
"avatar": "string"
}
message to room about new round questions
update information
{
"timestamp": 0,
"room": "string",
"data": [
{
"number1": 0,
"number2": 0,
"answer": 0
}
]
}
live game room channel
Available only on servers:
redis (join) game code
Accepts one of the following messages:
websocket connection to server
websocket disconnection from server
user leaving game message
request game info
updating class code for game
update game class info
{
"forGameCode": "string",
"classCode": "string",
"requireLogin": true
}
clearing class code for game
request game players
message from host to prepare next round
questions for the preparation round
[
{
"number1": 0,
"number2": 0,
"answer": 0
}
]
message from host to start next round (round should be prepared!)
player stats request
player answer
player answer data
{
"gameCode": "string",
"playerName": "string",
"userId": "string",
"clientId": "string",
"round": 0,
"questionBody": {
"type": "string",
"answer": 0,
"correct": true,
"time": 0
},
"boosterScore": 0,
"answerCount": 0
}
message from host to finish round
emits leaderboard message to sender
message from host about conscous game leaving or to room about host leaving
message to save game to mongo
clientId to kick
string
player selected avatar
avatar code
string
redis (join) game code
Accepts the following message:
player answer
player answer data
{
"gameCode": "string",
"playerName": "string",
"userId": "string",
"clientId": "string",
"round": 0,
"questionBody": {
"type": "string",
"answer": 0,
"correct": true,
"time": 0
},
"boosterScore": 0,
"answerCount": 0
}
timer sync message
date and time
websocket connection to server
websocket disconnection from server
user leaving game message
request game info
updating class code for game
update game class info
clearing class code for game
request game players
message from host to prepare next round
questions for the preparation round
message from host to start next round (round should be prepared!)
player stats request
player answer
player answer data
message from host to finish round
message from host about conscous game leaving or to room about host leaving
emits leaderboard message to sender
message to save game to mongo
clientId to kick
player selected avatar
avatar code
message from game host with new questions for round
message fires if game by websocket token data not found
message with current game information
redis game
message on websocket connection, that game already finished
message to room about new player joined
player info
message to room about player disconnection
player info
message to room about player leaving
clientId of left player
message to room about next game round (questions only)
game round info
message to room about next game round start
message to room about finished and saved game mongo code
game code at mongo (permanent code)
message to room with current game leaderboard
game leaderboard
message to room about new player avatar
update information
message to room about new round questions
update information
data to login with email and password
registered user auth token for http api requests packed as json web token string
registered user payload
guest auth token for http api requests packed as json web token string
guest auth token payload
game token for for websocket connection packed as json web token string
game token payload
information about player joining game
cvc challenge info
game number generator info
game type info
game rounds info
game round question basic
game question extended
player answer data
player info
game round info
base game info
player round stats
player game stats
game teacher's additional info
redis game
update game class info
create new live game data
game info compatible with v1 frontend
leaderboard record