Spotify WebAPI authorization - client credentials flow error invalid_client
Straight forward question, hopefully with a straight forward answer. I'm attempting to implement the client credentials flow via Node.js, using request. Here's my code var request = require('request'); var payload = config.spotify.clientID + ":" + config.spotify.clientSecret; var encodedPayload = new Buffer(payload).toString("base64"); var opts = { url: "https://accounts.spotify.com/api/token", method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded", "Authorization": "Bearer " + encodedPayload }, body: "grant_type=client_credentials&scope=playlist-modify-public playlist