$ curl -X GET "/api/game_data.php/game/get" \
-H "X-Api-Token: API_TOKEN"
{
"success": true,
"type": "game",
"game_id": 4,
"data": {
"text": "hello world",
"game_settings": {
"difficulty": "hard",
"max_players": 10
},
"last_updated": "2025-01-13T12:00:00Z"
}
}
$ curl -X PUT "/api/game_data.php/game/update" \
-H "X-Api-Token: API_TOKEN" \
-H "X-Api-Private-Token: PRIVATE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"game_settings": {
"difficulty": "hard",
"max_players": 10
},
"last_updated": "2025-01-13T12:00:00Z"
}'
{
"success": true,
"message": "Game data updated successfully",
"updated_at": "2026-01-13 14:24:23"
}
The two scopes behave differently by design. Game scope is world-readable with the API token — intended for live configuration (name and room rules, version policy, client config) that every client reads at startup. Writes need the private token, so treat them as deploys. Player scope is per-user JSON — progression, loadouts, stats — readable and writable with that player's token, or by admin calls carrying the token pair.
Player-scope fields are also what leaderboards sort on, so keep ranked values numeric and identically named across platforms. Payloads are stored verbatim — validate shape and size client-side before writing.