Plan/Plan/json-endpoints.md

101 lines
3.2 KiB
Markdown
Raw Normal View History

# 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
2021-03-25 14:54:28 +01:00
### `GET /player/<playername>/raw` `GET /player/<player UUID>/raw`
2021-03-25 14:54:28 +01:00
Obtain all data in the database for a player. (Note that this is an exception to the /v1/ endpoints)
2019-07-07 22:27:38 +02:00
### Tab endpoints
2019-07-07 22:27:38 +02:00
Endpoints for tab specific number data, processed for display.
2019-07-19 10:52:17 +02:00
Required parameters: `server`
Parameter|Expected value|Description
--|--|--
2019-07-19 10:52:17 +02:00
`server` | Name or UUID of a Plan server | Used for identifying Plan server that the data should be about
2019-07-07 22:27:38 +02:00
#### `GET /v1/serverOverview` - Server Overview tab
2019-07-07 22:27:38 +02:00
#### `GET /v1/onlineOverview` - Online Activity Overview tab.
2019-07-07 22:27:38 +02:00
#### `GET /v1/sessionsOverview` - Sessions tab.
2019-07-07 09:18:45 +02:00
2019-07-07 22:27:38 +02:00
#### `GET /v1/playerVersus` - PvP & PvE tab.
2019-07-07 09:18:45 +02:00
2019-07-07 22:27:38 +02:00
#### `GET /v1/playerbaseOverview` - Playerbase Overview tab.
2019-07-19 10:52:17 +02:00
#### `GET /v1/performanceOverview`
2019-07-19 10:52:17 +02:00
### `GET /v1/players`
2019-07-19 10:40:52 +02:00
Obtain data for `/server` player list.
2019-07-19 10:52:17 +02:00
Required parameters: `server`
Parameter|Expected value|Description
--|--|--
2019-07-19 10:52:17 +02:00
`server` | Name or UUID of a Plan server | Used for identifying Plan server that the data should be about
2019-07-06 15:41:17 +02:00
### `GET /v1/sessions`
Obtain data for `/server` session accordion. Returns configurable amount of sessions.
2019-07-19 10:52:17 +02:00
Required parameters: `server`
2019-07-06 15:41:17 +02:00
Parameter|Expected value|Description
--|--|--
2019-07-19 10:52:17 +02:00
`server` | Name or UUID of a Plan server | Used for identifying Plan server that the data should be about
2019-07-06 21:32:45 +02:00
### `GET /v1/kills`
Obtain data for `/server` kills table. Returns 100 most recent kills.
2019-07-19 10:52:17 +02:00
Required parameters: `server`
2019-07-06 21:32:45 +02:00
Parameter|Expected value|Description
--|--|--
2019-07-19 10:52:17 +02:00
`server` | Name or UUID of a Plan server | Used for identifying Plan server that the data should be about
2019-07-06 15:41:17 +02:00
### `GET /v1/graph`
Obtain data for graphs.
2019-07-19 10:52:17 +02:00
Required parameters: `server` and `type`
Parameter|Expected value|Description
--|--|--
2019-07-19 10:52:17 +02:00
`server` | Name or 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
2019-07-06 15:41:17 +02:00
`uniqueAndNew` | Player data points for each day, how many unique and how many new players were there each day. Last 180 days
`calendar` | Calendar data points for each day there is data for. Last 2 years.
2019-07-06 16:29:23 +02:00
`worldPie` | World Pie data of all sessions combined
2019-07-12 17:55:21 +02:00
`activity` | Activity stack graph and pie graph data
2019-07-13 10:28:59 +02:00
`geolocation` | World Map and bar graph data. World Map uses iso-a3 specification of Country codes and Bar graph uses country names.
`aggregatedPing` | Min, Avg, Max ping graph data.
`punchCard` | PunchCard graph data. (Scatter plot)
2019-07-20 16:40:15 +02:00
### `GET /v1/player`
Fetch all data for a player page
Required parameters: `player`
Parameter|Expected value|Description
--|--|--
`player` | Name or UUID of a player | Used for identifying player the data should be about