1
我想獲得一個刷新令牌,但我不斷收到400錯誤。以下是我的代碼。我究竟做錯了什麼?任何幫助,將不勝感激。謝謝。Python Spotify刷新令牌
clientid="xxx"
refreshkey="xxx"
secretkey="xxx"
spotifyurl="https://accounts.spotify.com/api/token"
spotifydata = {'grant_type': 'refresh_token', 'refresh_token':refreshkey}
response = requests.post(spotifyurl, data=spotifydata, auth=(clientid, secretkey))
這部分代碼對我來說看起來很好。您是否確保在您撥打電話時使用的變量看起來正確?你有沒有試過用cURL來做這件事,看看你是否可以爲你的客戶端ID /祕密和刷新令牌做一般的刷新工作? –
當我運行下面的curl命令時,我得到「invalid_client」 curl -H「授權:基本client_id:secret_key」-d「grant_type = refresh_token」-d「refresh_token = refresh_token」「https://accounts.spotify.com/API /令牌」 –