DB Server REST API Specification - dapucita/haxbotron GitHub Wiki
DB Server REST API Specification
APIs List
API Version | Root URL | Support APIs | Description |
---|---|---|---|
v1 | /api/v1/ruidlist | RUIDList |
RUIDs list saved on DB. |
v1 | /api/v1/room/:ruid | Player , BanList , SuperAdmin |
Room Data APIs. :ruid means room unique identifier. |
PlayerModel Type
Name | Type | Description |
---|---|---|
uid | number | inserted by db server |
ruid | string | inserted by db server |
auth | string | |
conn | string | |
name | string | |
rating | number | |
totals | number | |
disconns | number | |
wins | number | |
goals | number | |
assists | number | |
ogs | number | |
losePoints | number | |
balltouch | number | |
passed | number | |
mute | boolean | |
muteExpire | number | |
rejoinCount | number | |
joinDate | number | |
leftDate | number | |
malActCount | number |
BanListModel Type
Name | Type | Description |
---|---|---|
uid | number | inserted by db server |
ruid | string | inserted by db server |
conn | string | |
reason | string | |
register | number | |
expire | number |
SuperAdminModel Type
Name | Type | Description |
---|---|---|
uid | number | inserted by db server |
ruid | string | inserted by db server |
key | string | |
description | string |
RUIDList APIs
đ Read RUIDs
Request
Method | Request URL | Description |
---|---|---|
GET | / | Get exist all RUIDs list on DB. |
Response
Status | Body | Description |
---|---|---|
200 | { ruid : String }[] |
RUIDs list as object array |
404 | error | Not found. |
Player APIs
âšī¸ Create Player
Request
Method | Request URL | Description |
---|---|---|
POST | /player | register new player. |
Request Body
Type | Description | Required |
---|---|---|
PlayerModel | Yes |
Response
Status | Body | Description |
---|---|---|
204 | ||
400 | error |
âšī¸ Read Players
Request
Method | Request URL | Description |
---|---|---|
GET | /player | get all players list. |
Request Query
Name | Description |
---|---|
start | starting index for pagination |
count | items count for pagination |
Request Body
Type | Description | Required |
---|
Response
Status | Body | Description |
---|---|---|
200 | PlayerModel[] | |
404 | error |
âšī¸ Read Player
Request
Method | Request URL | Description |
---|---|---|
GET | /player/:auth | read player :auth |
Request Body
Key | Type | Description | Required |
---|
Response
Status | Body | Description |
---|---|---|
200 | PlayerModel | |
404 | error |
âšī¸ Update Player
Request
Method | Request URL | Description |
---|---|---|
PUT | /player/:auth | update player :auth |
Request Body
Type | Description | Required |
---|---|---|
PlayerModel | Yes |
Response
Status | Body | Description |
---|---|---|
204 | ||
404 | error |
âšī¸ Delete Player
Request
Method | Request URL | Description |
---|---|---|
DELETE | /player/:auth | delete player :auth |
Request Body
Type | Description | Required |
---|
Response
Status | Body | Description |
---|---|---|
204 | ||
404 | error |
BanList APIs
đĢ Create Ban List
Request
Method | Request URL | Description |
---|---|---|
POST | /banlist | register new player into ban list. |
Request Body
Type | Description | Required |
---|---|---|
BanListModel | Yes |
Response
Status | Body | Description |
---|---|---|
204 | ||
400 | error |
đĢ Read All Ban List
Request
Method | Request URL | Description |
---|---|---|
GET | /banlist | get all banned players list. |
Request Query
Name | Description |
---|---|
start | starting index for pagination |
count | items count for pagination |
Request Body
Type | Description | Required |
---|
Response
Status | Body | Description |
---|---|---|
200 | BanListModel[] | |
404 | error |
đĢ Read Ban List
Request
Method | Request URL | Description |
---|---|---|
GET | /banlist/:conn | read banned player :conn |
Request Body
Key | Type | Description | Required |
---|
Response
Status | Body | Description |
---|---|---|
200 | BanListModel | |
404 | error |
đĢ Update Ban List
Request
Method | Request URL | Description |
---|---|---|
PUT | /player/:conn | update banned player :conn |
Request Body
Type | Description | Required |
---|---|---|
BanListModel | Yes |
Response
Status | Body | Description |
---|---|---|
204 | ||
404 | error |
đĢ Delete Ban List
Request
Method | Request URL | Description |
---|---|---|
DELETE | /banlist/:conn | delete player :conn from ban list. |
Request Body
Type | Description | Required |
---|
Response
Status | Body | Description |
---|---|---|
204 | ||
404 | error |
SuperAdmin APIs
đ Create Super Admin Key
Request
Method | Request URL | Description |
---|---|---|
POST | /superadmin | register new super admin key. |
Request Body
Type | Description | Required |
---|---|---|
SuperAdminModel | Yes |
Response
Status | Body | Description |
---|---|---|
204 | ||
400 | error |
đ Read All Super Admin Keys
Method | Request URL | Description |
---|---|---|
GET | /superadmin | read all super admin keys |
Request Query
Name | Description |
---|---|
start | starting index for pagination |
count | items count for pagination |
Response
Status | Body | Description |
---|---|---|
200 | SuperAdminModel[] | |
404 | error |
đ Read Super Admin Key
Request
Method | Request URL | Description |
---|---|---|
GET | /superadmin/:key | read super admin key :key |
Request Body
Key | Type | Description | Required |
---|
Response
Status | Body | Description |
---|---|---|
200 | SuperAdminModel | |
404 | error |
đ Delete Super Admin Key
Request
Method | Request URL | Description |
---|---|---|
DELETE | /superadmin/:key | delete super admin key:key . |
Request Body
Type | Description | Required |
---|
Response
Status | Body | Description |
---|---|---|
204 | ||
404 | error |