Requests
Vote for a request
POST
/api/requests/{id}/voteOpen. Open to everyone who can reach Tempolight.
Adds a vote.
Path parameters
idstringrequiredA request id (r…).
Responses
200OKapplication/json
idstringr…
titlestringbystringvotesintegeratnumberWhen it was asked for (ms).
donebooleanmergedbooleanThe same song was asked for already: a vote was added.
404No such id.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X POST 'http://localhost:8080/api/requests/r2k8d1/vote'const res = await fetch("http://localhost:8080/api/requests/r2k8d1/vote", {
method: "POST",
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/requests/r2k8d1/vote",
)
print(res.json())Response
{
"id": "r2k8d1",
"title": "Daft Punk – One More Time",
"by": "Sam",
"votes": 3,
"at": 1762200000000
}{
"error": "That request is gone"
}