【发布时间】:2016-11-07 19:01:01
【问题描述】:
我提取了一个 client_credentials 令牌,虽然我可以访问 API 的其他部分,但我似乎无法提取播放列表信息。这绝对是一个公开的播放列表,但我得到了 401 Unauthorized。我是不是误会了什么?
编辑
例如,这有效:
放curl -I -s -X GET "https://api.spotify.com/v1/users/#{testUser}" -H "Authorization: Bearer {#{@accessToken}}"
这不会:
放curl -I -s -X GET "https://api.spotify.com/v1/users/#{testUser}/playlists/#{testPlaylist}?fields=href,name,owner(!href,external_urls),tracks.items(added_by.id,track(name,href,album(name,href)))" -H "Authorization: Bearer {#{@accessToken}}"
【问题讨论】:
-
错误信息是什么?
-
“此请求需要身份验证”。不幸的是,没有得到更多。
-
例如...
curl -s -X POST "#{TOKEN_URI}" --data "grant_type=client_credentials" -H "Authorization: Basic #{authorization}"curl -I -s -X GET "https://api.spotify.com/v1/users/spotify/playlists/59ZbFPES4DQwEjBpWHzrtC" -H "Authorization: Bearer {#{token}}"
标签: spotify