Now playing
Start the Spotify sign-in
POST
/api/nowplaying/spotify/loginAdmin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.Answers the Spotify sign-in address (PKCE, no client secret). Open it; Spotify comes back to redirectUri, which must be added to your Spotify app.
Responses
200OKapplication/json
urlstringredirectUristring403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X POST 'http://localhost:8080/api/nowplaying/spotify/login'const res = await fetch("http://localhost:8080/api/nowplaying/spotify/login", {
method: "POST",
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/nowplaying/spotify/login",
)
print(res.json())Response
{
"url": "https://accounts.spotify.com/authorize?client_id=…",
"redirectUri": "http://127.0.0.1:8080/api/nowplaying/spotify/callback"
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}