{% extends "base.jinja2" %} {% block title %}API - DarkflameServer{% endblock %} {% block css %} {% endblock %} {% block content %}
Every endpoint your account may use. Open one and press Try it out to call it as yourself, right here.
The same description is at /api/openapi.json (OpenAPI 3) for other tools.
Make an API token on your account page and send it with every request:
curl -H "Authorization: Bearer $TOKEN" http://localhost:2006/api/status
A token acts as your account with its current GM level, so each request needs the same permission as the page it matches,
and changing the account's level or banning it takes effect straight away. Using the API at all needs the api_access permission.
Live updates: open a WebSocket to /ws (with the same Authorization header, or your sign-in cookie) and send
{"event": "subscribe", "subscription": "chat_message"} (or table_changed, dashboard_update, ...).
Tables take DataTables-style bodies: {"start": 0, "length": 25, "search": "text"}. Calls that act on
online players answer {requestId}; GET /api/actions/{id} gives the result.