mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-06 15:44:49 +08:00
Documentation for currently implemented endpoints
This commit is contained in:
parent
f493a7167c
commit
b4907631bb
56
Plan/json-endpoints.md
Normal file
56
Plan/json-endpoints.md
Normal file
@ -0,0 +1,56 @@
|
||||
# JSON endpoints
|
||||
|
||||
This document details what endpoints are available on a Plan webserver and what parameters they require.
|
||||
|
||||
What the endpoints return is not detailed to save time, as this document is written during implementation.
|
||||
|
||||
Parameters are given in the URL: `address/v1/<endpoint>?parameter=value&another=value`
|
||||
|
||||
If invalid parameters are given the server will return 400 Bad Request.
|
||||
The body of the response is the error message
|
||||
|
||||
## Endpoints
|
||||
|
||||
### `GET /<playername>/raw` `GET /<player UUID>/raw`
|
||||
|
||||
Obtain all data in the database for a player.
|
||||
|
||||
### `GET /v1/serverOverview`
|
||||
|
||||
Obtain data for Server Overview tab (The first tab on `/server`-page)
|
||||
|
||||
Required parameters: `serverName` or `serverUUID`
|
||||
|
||||
Parameter|Expected value|Description
|
||||
--|--|--
|
||||
`serverName` | Name of a Plan server | Used for identifying Plan server that the data should be about
|
||||
`serverUUID` | UUID of a Plan server | Used for identifying Plan server that the data should be about
|
||||
|
||||
### `GET /v1/players`
|
||||
|
||||
Obtain data for `/server` player list.
|
||||
|
||||
Required parameters: `serverName` or `serverUUID`
|
||||
|
||||
Parameter|Expected value|Description
|
||||
--|--|--
|
||||
`serverName` | Name of a Plan server | Used for identifying Plan server that the data should be about
|
||||
`serverUUID` | UUID of a Plan server | Used for identifying Plan server that the data should be about
|
||||
|
||||
### `GET /v1/graph`
|
||||
|
||||
Obtain data for graphs.
|
||||
|
||||
Required parameters: `serverName` or `serverUUID` and `type`
|
||||
|
||||
Parameter|Expected value|Description
|
||||
--|--|--
|
||||
`serverName` | Name of a Plan server | Used for identifying Plan server that the data should be about
|
||||
`serverUUID` | UUID of a Plan server | Used for identifying Plan server that the data should be about
|
||||
`type` | `performance`, `uniqueAndNew` | What kind of graph data should be given
|
||||
|
||||
Type | Description
|
||||
-- | --
|
||||
`performance` | TPS data points for last 6 months: Players Online, TPS, CPU, RAM, Chunks, Entities, Disk Space
|
||||
`uniqueAndNew` | Player data points for each day, how many unique and how many new players were there each day.
|
||||
|
Loading…
Reference in New Issue
Block a user