luca
luca

Reputation: 12611

Dropbox API - Dropbox ruby gem (Tim Morgan): How to authorize

I want to write a ruby app for personal use that access my personal dropbox through their API. I'm using Tim Morgan gem 'dropbox' version 1.1.1 What I don't understand is the difference between a developer_key and a consumer_key. The gem docs say that I have to use the consumer_key, but when I registered my app on dropbox.com I received only a developer key secret pair (and that's what I put in Dropbox::Session.new)

Anyway the error I get from ruby at every API call is:

Dropbox::UnsuccessfulResponseError: HTTP status Net::HTTPBadRequest

any idea??

Upvotes: 2

Views: 873

Answers (1)

hellvinz
hellvinz

Reputation: 3500

You have to redirect your user to the oauth page where he will grant you the authorization to access the datas. This can be done wit something like that:

  dropbox_session = Dropbox::Session.new('bla', 'blabla')
  redirect_to dropbox_session.authorize_url(:oauth_callback => root_url)

Upvotes: 3

Related Questions