Soundcloud API 401在使用/解析时未经授权
我正在使用“不使用SoundCloud连接屏幕进行身份验证”的身份验证方法(请参阅)。这是一种提供全部凭证的方法——客户机id、客户机机密、用户名和密码。我也在使用Ruby SDKSoundcloud API 401在使用/解析时未经授权,api,soundcloud,Api,Soundcloud,我正在使用“不使用SoundCloud连接屏幕进行身份验证”的身份验证方法(请参阅)。这是一种提供全部凭证的方法——客户机id、客户机机密、用户名和密码。我也在使用Ruby SDK # create client object with app and user credentials client = Soundcloud.new(:client_id => 'YOUR_CLIENT_ID', :client_secret => 'Y
# create client object with app and user credentials
client = Soundcloud.new(:client_id => 'YOUR_CLIENT_ID',
:client_secret => 'YOUR_CLIENT_SECRET',
:username => 'YOUR_USERNAME',
:password => 'YOUR_PASSWORD')
我正在尝试使用客户端解析用户
puts client.get('/resolve', :url => 'https://soundcloud.com/random-username').inspect
但是,我不断收到客户端返回的401个未经授权的
我可以确认我正在进行身份验证,因为以下操作执行良好
puts client.get('/me').username
有人知道我做错了什么吗?我发现你需要在每个请求中包含你的客户id
puts client.get('/resolve', :url => 'https://soundcloud.com/random-username', client_id: 'YOUR_CLIENT_ID')