Now playing

Finish the Spotify sign-in

POST/api/nowplaying/spotify/code
Admin. Needs an unlock token (x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.

For signing in from another device: paste the address Spotify sent the browser to (or its code and state).

Request body application/json

urlstring

The address Spotify sent the browser to.

codestring
statestring

Responses

200OKapplication/json
enabledboolean
supportedboolean
platformstring
statestring
One of "ok" "starting" "unavailable" "error" "off"
messagestring | null
methodstring | null
One of "osascript" "playerctl" "dbus-send" "powershell" null
trackobject | null

{source, app, device, title, artist, album, dur, pos, playing, posKnown, remembered, following}.

spotifyobject
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.

Request
curl -X POST 'http://localhost:8080/api/nowplaying/spotify/code' \
  -H 'content-type: application/json' \
  -d '{
  "url": "http://127.0.0.1:8080/api/nowplaying/spotify/callback?code=AQB…&state=x1y2"
}'
Response
{
  "enabled": true,
  "supported": true,
  "platform": "darwin",
  "state": "ok",
  "message": null,
  "method": "osascript",
  "track": null,
  "spotify": {
    "clientId": "",
    "connected": false,
    "error": null,
    "redirectUri": "http://127.0.0.1:8080/api/nowplaying/spotify/callback"
  }
}
Edit on GitHub