Spotify
Send cover colours
POST
/api/spotify/colorsGuest area “effects”. Open unless a PIN lock is set and guests aren't allowed this area (
settings.guest.effects); then it needs an unlock token.The album cover's colours, which the browser works out, for the palette.
Request body application/json
artstringrequiredThe cover's https address.
colorsstring[]required2 to 4 colours.
2 to 4 items
Responses
200OKapplication/json
oktruerequired400The 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 POST 'http://localhost:8080/api/spotify/colors' \
-H 'content-type: application/json' \
-d '{
"art": "https://i.scdn.co/image/ab67616d0000b273",
"colors": [
"#1db954",
"#191414",
"#ffffff"
]
}'const res = await fetch("http://localhost:8080/api/spotify/colors", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"art": "https://i.scdn.co/image/ab67616d0000b273",
"colors": [
"#1db954",
"#191414",
"#ffffff"
]
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/spotify/colors",
json={
"art": "https://i.scdn.co/image/ab67616d0000b273",
"colors": [
"#1db954",
"#191414",
"#ffffff"
]
},
)
print(res.json())Response
{
"ok": true
}{
"error": "{art, colors: ['#rrggbb', '#rrggbb', ...]}"
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}