3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

dropbox-sdk gem で指定ファイルを読み込む方法

Posted at

~/Dropbox/a.txt に相当するファイルを、APIを使って読み出す手順です。

  1. https://www.dropbox.com/developers/apps にアクセスして create app クリック
  2. dropbox API app 選択
  3. Can your app be limited to its own folder? (アプリ専用フォルダを作るか?) → No
  4. What type of files does your app need access to? (アクセスしたいファイル) → All file types
  5. アプリ名入力
  6. create クリック
  7. OAuth2 の Generate access token の Generate をクリックして表示されたのをコピー
  8. gem install dropbox-sdk 実行 (dropbox-sdkは公式のgem)
  9. 以下実行
require "dropbox_sdk"
client = DropboxClient.new("7でコピーしたトークン")
p client.get_file("/a.txt")
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?