Games
Game state (from the game)
POST
/api/gsi/{game}Game token. Open, but the body must carry the game's token (
auth.token, from its config file).Where the games post their state. Open, but only with the token from the game's config file (auth.token). At most 40 a second; 30 wrong tokens in a minute block it for a minute.
Path parameters
gamestringrequiredcs2 or dota2.
Request body application/json
object
Valve game-state integration JSON, with auth.token.
Responses
200OKapplication/json
okbooleanoffbooleanThe game is turned off in Tempolight.
403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
404No such id.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
429Too many calls; wait a little.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X POST 'http://localhost:8080/api/gsi/cs2' \
-H 'content-type: application/json' \
-d '{
"provider": {
"name": "Counter-Strike 2"
},
"player": {
"state": {
"health": 100,
"flashed": 0
}
},
"auth": {
"token": "9f8e7d6c5b4a39281706f5e4d3c2b1a0"
}
}'const res = await fetch("http://localhost:8080/api/gsi/cs2", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"provider": {
"name": "Counter-Strike 2"
},
"player": {
"state": {
"health": 100,
"flashed": 0
}
},
"auth": {
"token": "9f8e7d6c5b4a39281706f5e4d3c2b1a0"
}
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/gsi/cs2",
json={
"provider": {
"name": "Counter-Strike 2"
},
"player": {
"state": {
"health": 100,
"flashed": 0
}
},
"auth": {
"token": "9f8e7d6c5b4a39281706f5e4d3c2b1a0"
}
},
)
print(res.json())Response
{
"ok": true
}{
"error": "Wrong or missing game token: download the config file again from Tempolight's Integrations page"
}{
"error": "Unknown game (cs2 or dota2)"
}{
"error": "Too many updates"
}