zendesk / dropbox-api

Dropbox API Ruby Client
Apache License 2.0
362 stars 78 forks source link

How to use auth token generated on Dropbox App Console #60

Open sasa-friedrich-bitlab opened 9 years ago

sasa-friedrich-bitlab commented 9 years ago

I'm trying to use dropbox with generated access token from Dropbox App Console.

If I execute:

curl https://api.dropbox.com/1/account/info -H "Authorization:Bearer <MY-ACCESS-TOKEN>"

request successfully returns my account info.

How can I use this access_token with 'dropbox-api'?

I tried (in Rails console):

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

...and get: "Dropbox::API::Error::Unauthorized: 401 - Bad or expired token"

What am I missing?

darkogj commented 4 years ago

Afraid I have the same error. Tried dropbox_api and got no error. It seems something's wrong with this gem.