This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
API Reference
Jannik Emmerich edited this page Feb 22, 2021
·
6 revisions
Request:
{
"tag":"<tag of the request [string, UUID]>",
"ms":"<microservice [string]>",
"endpoint":"<microservice endpoint [string]>",
"data":"<data sent to the microservice [JSON]>"
}
Response:
{
"tag":"<tag of the request [string, UUID]>",
"data":"<data sent by the microservice [JSON]>"
}
Errors:
- microservice did not answer
{
"error":"timeout"
}
Request:
{
"action":"status"
}
Response:
{
"online":"<number of online players [number]>"
}
Request:
{
"action":"setting",
"key":"<key [string]>",
"value":"<value [string]>"
}
Response:
{
"key":"<key [string]>",
"value":"<value [string]>"
}
Errors:
- the key or the value is to long
{
"error":"unsupported parameter size"
}
Request:
{
"action":"setting",
"key":"<key [string]>"
}
Response:
{
"key":"<key [string]>",
"value":"<value [string]>"
}
Errors:
- the setting does not exist
{
"error":"unknown setting"
}
Request:
{
"action":"setting",
"key":"<key [string]>",
"delete":""
}
Response:
{
"success":true
}
Errors:
- the setting does not exist
{
"error":"unknown setting"
}
Request:
{
"action":"login",
"name":"<username [string]>",
"password":"<password [string]>"
}
Response:
{
"token":"<session token [string, UUID]>"
}
Errors:
- missing parameters
{
"error":"missing parameters"
}
- wrong password or nonexistent user
{
"error":"permissions denied"
}
Prerequisite: the user must be logged in
Request:
{
"action":"logout"
}
Response:
{
"status":"logout"
}
Request:
{
"action":"session",
"token":"<session token [string, UUID]>"
}
Response:
{
"token":"<session token [string, UUID]>"
}
Errors:
- missing parameters
{
"error":"missing parameters"
}
- token is not valid
{
"error":"invalid token"
}
Request:
{
"action":"register",
"name":"<username [string]>",
"password":"<password [string]>"
}
Response:
{
"token":"<session token [string, UUID]>"
}
Errors:
- missing parameters
{
"error":"missing parameters"
}
- password does not meet the requirements
{
"error":"invalid password"
}
- mail address does not meet the requirements
{
"error":"invalid email"
}
- username already exists
{
"error":"username already exists"
}
Request:
{
"action":"password",
"name":"<username [string]>",
"password":"<old password [string]>",
"new":"<new password [string]>",
}
Response:
{
"success":true
}
Errors:
- missing parameters
{
"error":"missing parameters"
}
- password is not correct, new password does not meet the requirements or the user does not exists
{
"error":"permissions denied"
}
Prerequisite: the user must be logged in
Request:
{
"action":"info"
}
Response:
{
"name":"<username [string]>",
"uuid":"<uuid of the user [string, UUID]>",
"mail":"<mail address [string]>",
"created":"<timestamp when the user was created [number]>",
"last":"<timestamp when the user was last logged in [number]>",
"online":"<number of online players [number]>
}
Prerequisite: the user must be logged in
Request:
{
"action":"delete"
}
Response:
{
"status":"logout"
}
Request:
{
"action":"register",
"name":"<name of the microservice [string]>"
}
Errors:
- missing parameters
{
"error":"missing parameters"
}
Request:
{
"action":"address",
"user":"<uuid of the user [string, UUID]>",
"data":"<data sent to the user [JSON]>"
}
Errors:
- missing parameters
{
"error":"missing parameters"
}
Request:
{
"action":"user",
"tag":"<uuid of the request [string, UUID]>",
"data":{"user":"<uuid of the user [string, UUID]>"}
}
Response:
- user is not valid
{
"tag":"<uuid of the request [string, UUID]>",
"data":{"valid":false}
}
- user is valid
{
"tag":"<uuid of the request [string, UUID]>",
"data":
{
"valid":true,
"uuid":"<uuid of the user [string, UUID]>",
"name":"<username of the user [string]>",
"mail":"<mail address of the user [string]>",
"created":"<timestamp when the user was created [number]>",
"last":"<timestamp when the user was last logged in [number]>"
}
}
Errors:
- missing parameters
{
"error":"missing parameters"
}