Developers»API

Developers

API

Learn how to utilise our web API with Analyse.


While our Java SDK automatically includes these APIs within all of our plugins, you may wish to include these yourself if you've got an enterprise-level setup.

All requests made to Analyse require the X-SERVER-TOKEN header to be present containing your servers token. Our current base url for all endpoints is https://app.analyse.net/api/v1/.

Get Server

Get basic information about a server from its token.

  • URL: server
  • Method: GET

Example Response:

{  "data": {    "name": "Survival",    "uuid": "95974723-865a-42c1-8490-b21094f0cfa9",    "created_at": "2022-02-13T16:27:41.000000Z",    "team_quota": {      "current": 22396,      "limit": 50000    }  }}

Heartbeat

Send a server heartbeat with the current player count.

  • URL: server/heartbeat
  • Method: POST

Example Payload:

{  "players": 300}

Example Response:

{  "success": true}

Add Session

Submits a player session for that particular server.

  • URL: server/sessions
  • Method: POST

Example Payload:

{  "name": "User",  "uuid": "3234-2324-3232-32323",  "joined_at": "2021-12-29 16:58:24.436228",  "quit_at": "2021-12-29 19:58:24.436228",  "ip_address": "017386cd32f983e735db582718f11ffbc9b1233b06f16383f13f6d23823da0e3",  "country": "GB",  "stats": [    {      "key": "player_kills",      "value": "100"    }  ]}

Example Response:

{  "success": true}

By sending this payload, any placeholders within the stats key will be added to the database if the server has also specified this within their dashboard.