Server Routes
Add a new Server
POST /server/newServer
This will create a new server for the project to use
Headers
Content-Type
application/json
Authorization
<key>
Body
serverName
string
Name of the server
serverIp
string
IP Address of the server
serverPort
number
Port number for the server
Response
{
"created": boolean
}{
"error": {
"code": number,
"message": "Could not add a new server to the data"
},
"catchError": exception
}If authorization header not provided:
{
"error": {
"code": 403
"message": "Please specify an authorization key!"
}
}If invalid authorization key:
{
"error": {
"code": 403,
"message": "Invalid authorization Key!"
}
}Get Servers Data
GET /server
This will return the servers that the API has in its stored list
Response
Get server online players
GET /server/getOnlinePlayers
This will return a list of the online players from the servers in the servers data list
Response
Create a new data day
POST /server/newDay/[ Server Identifier ]
This will create a new days record for the database.
Headers
Content-Type
application/json
Authorization
<key>
Request
Server Identifier
string
The identifier value for the server it is linked to
Response
If authorization header not provided:
If invalid authorization key:
Increment the new users column
POST /server/newDay/incrementNewUsers/[ Server Identifier ]
This will create a new days record for the database.
Headers
Content-Type
application/json
Authorization
<key>
Request
Server Identifier
string
The identifier value for the server it is linked to
Response
If authorization header not provided:
If invalid authorization key:
Increment the new users column
POST /server/newDay/incrementReturningUsers/[ Server Identifier ]
This will create a new days record for the database.
Headers
Content-Type
application/json
Authorization
<key>
Request
Server Identifier
string
The identifier value for the server it is linked to
Response
If authorization header not provided:
If invalid authorization key:
Get Server Data
GET /server/getData/[ Server Identifier ]
This will return the server data for the day given a servers identifier
Request
Server Identifier
string
The identifier value for the server it is linked to
Response
Get Server Data For a number of days
GET /server/getData/[ Server Identifier ]/[ Number Days ]
This will return the server data for the day given a servers identifier and a number of days
Request
Server Identifier
string
The identifier value for the server it is linked to
Number Days
number
The number of days to query for
Response
Last updated