Skip to content

API Refresh Key Setup

Jon Prentice edited this page Feb 16, 2019 · 1 revision
  1. Go to the following URL in a web browser and allow access to the streaming device's account:

https://accounts.spotify.com/authorize/?client_id=<CLIENT_ID>&response_type=code&redirect_uri=<REDIRECT_URI>&scope=user-read-private

  1. Copy URL of the redirected address, and use the value for code, this is the authorization code for the next step.

  2. Create a base64-encoded string of the following:

<CLIENT_ID>:<CLIENT_SECRET>

  1. Take the base64-encoded string and the authorization code, and run the following command to retrieve the refresh_token:

curl -H "Authorization: Basic <BASE_64-ENCODED_STRING>" -d grant_type=authorization_code -d code=<AUTHORIZATION_CODE> -d redirect_uri=<REDIRECT_URL> https://accounts.spotify.com/api/token

Clone this wiki locally