In Google scripts, I am attempting to call the client_credentials OAuth flow from spotify, while it should return the access token, the request fails with code 405.
data = {
'grant_type':'client_credentials',
'client_id' : 'CLIENT_ID',
'client_secret' : 'CLIENT_SECRET'
}
var access_token= UrlFetchApp.fetch('https://accounts.spotify.com/api/token', data);
More on spotify OAUTH https://developer.spotify.com/web-api/authorization-guide/#client-credentials-flow