Spotify
Change Spotify sync
PATCH
/api/spotifyAdmin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.Any of: follow Spotify, learn beat maps by listening, use Spotify's own analysis, cover colours, fade on pause, dim when muted, and the shared beat-map service.
Request body application/json
syncbooleanlearnbooleananalysisbooleancoverColoursbooleanpauseFadebooleanmuteDimbooleancloudobjectResponses
200OKapplication/json
settingsobjectonbooleanconnectedbooleanmodestringOne of
"exact" "shared" "analysis" "learning" "live" "paused" "idle" "off"modeNamestringviastring | nullerrorstring | nulltrackobject | nullThe Spotify track.
mapobject | nullThe beat map in use.
learnobject | nullLearning progress.
lockedbooleananalysisstringOne of
"off" "blocked" "unknown"accountobjectThe connected account.
localobjectNow playing on this computer.
pollobjectPolling timing.
cloudobjectThe shared beat-map service.
colorsarray | null400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X PATCH 'http://localhost:8080/api/spotify' \
-H 'content-type: application/json' \
-d '{
"sync": true,
"coverColours": true
}'const res = await fetch("http://localhost:8080/api/spotify", {
method: "PATCH",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"sync": true,
"coverColours": true
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.patch(
"http://localhost:8080/api/spotify",
json={
"sync": True,
"coverColours": True
},
)
print(res.json())Response
{
"settings": {
"sync": true,
"learn": true,
"analysis": true,
"coverColours": true,
"pauseFade": true,
"muteDim": true,
"cloud": {
"url": "string",
"use": true,
"share": true
}
},
"on": true,
"connected": true,
"mode": "exact",
"modeName": "string",
"via": "string",
"error": "string",
"track": {},
"map": {},
"learn": {},
"locked": true,
"analysis": "off",
"account": {},
"local": {},
"poll": {},
"cloud": {},
"colors": [
"#ff0066"
]
}{
"error": "The beat-map service address starts with https:// (your Worker's address)"
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}