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

idstringrequired

A request id (r…).

Request body application/json

doneboolean

Responses

200OKapplication/json
idstring

r…

titlestring
bystring
votesinteger
atnumber

When it was asked for (ms).

doneboolean
mergedboolean

The same song was asked for already: a vote was added.

403Locked, or not allowed.application/json
errorstringrequired

What went wrong, in a sentence for people.

404No such id.application/json
errorstringrequired

What 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
}'
Response
{
  "id": "r2k8d1",
  "title": "Daft Punk – One More Time",
  "by": "Sam",
  "votes": 3,
  "at": 1762200000000
}
Edit on GitHub