OstatníTechnické
[DEMO] Game Panel API: getting started
How to create an API key and make your first requests to the panel client API.
Na této stránce
Applies toGame Panel
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.
Store it safely
It is shown only once. Treat it like a password.
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
| Method | Route | What it does |
|---|---|---|
| GET | /api/client | Lists your servers |
| GET | /api/client/servers/[ID]/resources | CPU, memory and disk usage |
| POST | /api/client/servers/[ID]/power | Starts or stops it ({"signal": "start"}) |