/dropbox-api-practice

Practice for using Dropbox API on Clojure.

Primary LanguageClojure

dropbox-api-practice

Practice for using Dropbox API on Clojure.

Dependes clj-oauth version 1.2.10.

Usage

  1. Make Account on Dropbox.

  2. Create "My Apps" on Dropbox for Developers page.

  3. Get API Keys (developer-token and developer-secret).

  4. lein deps, lein repl

Examples

  • Getting Dropbox account info.

on repl :

(use 'dropbox-api-practice.core)

;; get access token
(def my-consumer (new-consumer "developer-token" "developer-secret"))
(def my-access-token (get-access-token my-consumer "user mailaddress" "password"))

;; API call
(get-account-info my-consumer my-access-token)
  • Getting file metadata.

Before run this code, make test file ~/Dropbox/api_test/test.txt.

(get-metadata my-consumer myaccess-token "/api_test/test.txt")

Edit test file, after run same code, check to update metadata.

References

http://d.hatena.ne.jp/teru_kusu/20110120/1295520678

https://www.dropbox.com/developers/docs

https://github.com/mattrepl/clj-oauth

http://tzmtk.pbworks.com/w/page/7618696/OAuthCore10aJP

https://github.com/aria42/clj-dropbox

License

Copyright (c) 2011 MISUMI Masaru(deltam@gmail.com).

Licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)