我正在尝试使用带有Dropbox App Console生成的访问令牌的Dropbox .
如果我执行:
curl https://api.dropbox.com/1/account/info -H "Authorization:Bearer <MY-ACCESS-TOKEN>"
请求成功返回我的帐户信息 .
如何将此access_token与'dropbox-api'一起使用?
我试过(在Rails控制台中):
Dropbox::API::Config.app_key = 'my_app_key'
Dropbox::API::Config.app_secret = 'my_app_secret'
Dropbox::API::Config.mode = 'dropbox'
client = Dropbox::API::Client.new(token: 'my_generated_access_token')
client.account
...并获取:“Dropbox :: API :: Error :: Unauthorized:401 - Bad or expired token”
我错过了什么?
1 回答
它看起来像我的宝石(假设我找到了正确的宝石:https://github.com/futuresimple/dropbox-api/)没有办法使用你通过App Console生成的令牌 . 如果您想使用该gem,则需要通过OAuth 1进行身份验证 .