Requests
Mark a request played
PATCH
/api/requests/{id}Admin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.{done: true} when it has been played.
Path parameters
idstringrequiredA request id (r…).
Request body application/json
donebooleanResponses
200OKapplication/json
idstringr…
titlestringbystringvotesintegeratnumberWhen it was asked for (ms).
donebooleanmergedbooleanThe same song was asked for already: a vote was added.
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 PATCH 'http://localhost:8080/api/requests/r2k8d1' \
-H 'content-type: application/json' \
-d '{
"done": true
}'const res = await fetch("http://localhost:8080/api/requests/r2k8d1", {
method: "PATCH",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"done": true
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.patch(
"http://localhost:8080/api/requests/r2k8d1",
json={
"done": True
},
)
print(res.json())Response
{
"id": "r2k8d1",
"title": "Daft Punk – One More Time",
"by": "Sam",
"votes": 3,
"at": 1762200000000
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}{
"error": "No such request"
}