Exped API Dokumentace
Základní technická dokumentace pro launcher, hru, realtime komunikaci a bug reporty.
Produkční base URL API je https://exped-api.enoasoft.cz.
Veřejné API endpointy
GET
/status
Vrací stav API, databáze a aktuální manifest.
curl https://exped-api.enoasoft.cz/status
GET
/version
Vrací verzi API a aktuální verzi hry z manifestu.
curl https://exped-api.enoasoft.cz/version
GET
/manifest
Vrací aktuální update manifest.
curl https://exped-api.enoasoft.cz/manifest
GET
/counts
Vrací počty z databáze.
curl https://exped-api.enoasoft.cz/counts
Launcher endpointy
GET
/launcher/latest
Vrací aktuální aktivní build z databáze. Pokud není v DB, použije manifest.
curl https://exped-api.enoasoft.cz/launcher/latest
GET
/launcher/check?version=0.0.1
Porovná klientskou verzi s aktuální verzí a vrátí, jestli je dostupný update.
curl "https://exped-api.enoasoft.cz/launcher/check?version=0.0.1"
GET
/launcher/manifest
Vrací manifest a URL potřebné pro launcher.
curl https://exped-api.enoasoft.cz/launcher/manifest
Bug report API
Tento endpoint vyžaduje API token v hlavičce
X-API-Token.
Token vytvoříš v panelu: https://exped-panel.enoasoft.cz/tokens.php.
POST
/bug-report
Uloží nový bug report do databáze.
curl -X POST https://exped-api.enoasoft.cz/bug-report \
-H "Content-Type: application/json" \
-H "X-API-Token: TVUJ_TOKEN" \
-d '{
"title": "Chyba launcheru",
"description": "Launcher spadne při kontrole verze.",
"reporter_name": "Tester",
"reporter_email": "tester@example.com",
"build_version": "0.0.1"
}'
GET
/token-check
Ověří, jestli je API token platný.
curl https://exped-api.enoasoft.cz/token-check \ -H "X-API-Token: TVUJ_TOKEN"
WebSocket realtime
WebSocket endpoint:
wss://exped-ws.enoasoft.cz
GET
https://exped-ws.enoasoft.cz/status
HTTP status WebSocket služby.
curl https://exped-ws.enoasoft.cz/status
Test v browser konzoli:
const ws = new WebSocket('wss://exped-ws.enoasoft.cz');
ws.onopen = () => {
console.log('connected');
ws.send(JSON.stringify({ type: 'ping' }));
};
ws.onmessage = (event) => {
console.log('message:', event.data);
};
Základní zprávy:
{ "type": "ping" }
{ "type": "broadcast", "message": "Ahoj realtime!" }