Skip to content

Instantly share code, notes, and snippets.

@RachelSa
Created March 2, 2017 19:07
Show Gist options
  • Save RachelSa/d7131c15a33cb339b1d673850a438a38 to your computer and use it in GitHub Desktop.
Save RachelSa/d7131c15a33cb339b1d673850a438a38 to your computer and use it in GitHub Desktop.
client_token = Base64.strict_encode64("#{ENV['spotify_id']}:#{ENV['spotify_secret']}")
spotify_token = RestClient.post("https://accounts.spotify.com/api/token",{"grant_type": "client_credentials"}, {"Authorization": "Basic #{client_token}"})
parsed_token = JSON.parse(spotify_token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment