Requests

Request a song

POST/api/requests
Open. Open to everyone who can reach Tempolight.

Asks for a song. The same song again adds a vote instead (merged: true). At most 30 a minute.

Request body application/json

titlestringrequired
Up to 120 characters
bystring
Up to 40 characters

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.

400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequired

What went wrong, in a sentence for people.

403Locked, or not allowed.application/json
errorstringrequired

What went wrong, in a sentence for people.

429Too many calls; wait a little.application/json
errorstringrequired

What went wrong, in a sentence for people.

Request
curl -X POST 'http://localhost:8080/api/requests' \
  -H 'content-type: application/json' \
  -d '{
  "title": "Daft Punk – One More Time",
  "by": "Sam"
}'
Response
{
  "id": "r2k8d1",
  "title": "Daft Punk – One More Time",
  "by": "Sam",
  "votes": 3,
  "at": 1762200000000
}
Edit on GitHub