Music
Send the song's clock
POST
/api/song/clockOpen. Open to everyone who can reach Tempolight.
Where the song is now. Send it on play, pause and seek, and every second or so (the WebSocket's clock message does the same).
Request body application/json
posnumberrequiredSeconds.
playingbooleanrequiredratenumberDefault
1Responses
200OKapplication/json
oktruerequiredRequest
curl -X POST 'http://localhost:8080/api/song/clock' \
-H 'content-type: application/json' \
-d '{
"pos": 42.3,
"playing": true,
"rate": 1
}'const res = await fetch("http://localhost:8080/api/song/clock", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"pos": 42.3,
"playing": true,
"rate": 1
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/song/clock",
json={
"pos": 42.3,
"playing": True,
"rate": 1
},
)
print(res.json())Response
{
"ok": true
}