ข้ามไปยังเนื้อหา
อื่นๆเชิงเทคนิค

[DEMO] Game Panel API: getting started

How to create an API key and make your first requests to the panel client API.

บทความนี้ยังไม่มีในภาษาไทย คุณกำลังอ่านฉบับภาษาอังกฤษ
ในหน้านี้
Applies toGame Panel
  1. Create an API key

    In the panel, go to Account → API Credentials [To be confirmed], add a description and, if you can, restrict it to your IP.

  2. Store it safely

    It is shown only once. Treat it like a password.

  3. Make your first request

    List your servers with the example below.

Examples

bash
curl -s https://gamepanel.fusiora.com/api/client \
  -H "Authorization: Bearer [YOUR_API_KEY]" \
  -H "Accept: application/json"
python
import requests

r = requests.get(
    "https://gamepanel.fusiora.com/api/client",
    headers={"Authorization": "Bearer [YOUR_API_KEY]", "Accept": "application/json"},
    timeout=10,
)
print(r.json())
javascript
const r = await fetch('https://gamepanel.fusiora.com/api/client', {
  headers: { Authorization: 'Bearer [YOUR_API_KEY]', Accept: 'application/json' },
});
console.log(await r.json());

Useful routes

MethodRouteWhat it does
GET/api/clientLists your servers
GET/api/client/servers/[ID]/resourcesCPU, memory and disk usage
POST/api/client/servers/[ID]/powerStarts or stops it ({"signal": "start"})