2

我阅读了 Dropbox SDK for Ruby 的文档,但找不到有关使用我自己的 Dropbox 帐户的示例。我看到的示例要求我从一个为我验证会话的随机用户那里获得一个 ACCESS_TOKEN。

我是用户!我只想开始上传和删除文件;而已。

我该如何做到这一点?

编辑:

片段

require 'dropbox_sdk'

APP_KEY = '******'
APP_SECRET = '*****'
ACCESS_TYPE = :dropbox

session = DropboxSession.new(APP_KEY, APP_SECRET)


#I don't want to do this, I just want to know the way of authenticate
#myself with some method that don't need authorization

#-------------------------------------------
session.get_request_token

authorize_url = session.get_authorize_url


puts "AUTHORIZING", authorize_url
puts "Please visit that website and hit 'Allow', then hit Enter here."
gets


session.get_access_token

client = DropboxClient.new(session, ACCESS_TYPE)
puts "linked account:", client.account_info().inspect
4

0 回答 0