Games
Test a game event
POST
/api/integrations/games/{game}/testAdmin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.Pretends it happened.
Path parameters
gamestringrequiredcs2 or dota2.
Request body application/json
whatstringrequiredOne of
"flash" "bomb" "kill" "win" "lose" "roshan" "night" "day" "low"Responses
200OKapplication/json
oktruerequired400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
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.
Request
curl -X POST 'http://localhost:8080/api/integrations/games/cs2/test' \
-H 'content-type: application/json' \
-d '{
"what": "bomb"
}'const res = await fetch("http://localhost:8080/api/integrations/games/cs2/test", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"what": "bomb"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/integrations/games/cs2/test",
json={
"what": "bomb"
},
)
print(res.json())Response
{
"ok": true
}{
"error": "Turn Counter-Strike 2 on first"
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}{
"error": "Unknown game"
}