Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ammmir/elixir-dropbox
Dropbox Core API client for Elixir
https://github.com/ammmir/elixir-dropbox
Last synced: 7 days ago
JSON representation
Dropbox Core API client for Elixir
- Host: GitHub
- URL: https://github.com/ammmir/elixir-dropbox
- Owner: ammmir
- License: mit
- Created: 2014-05-01T07:52:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-10T20:52:56.000Z (about 10 years ago)
- Last Synced: 2024-10-06T08:46:16.405Z (about 1 month ago)
- Language: Elixir
- Size: 230 KB
- Stars: 13
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Dropbox Core API client for Elixir. (Third Party APIs)
- fucking-awesome-elixir - dropbox - Dropbox Core API client for Elixir. (Third Party APIs)
- awesome-elixir - dropbox - Dropbox Core API client for Elixir. (Third Party APIs)
README
# elixir-dropbox
A Dropbox Core API client for Elixir, based on [hackney](https://github.com/benoitc/hackney) and [Jazz](https://github.com/meh/jazz).
The Dropbox module provides the thinnest layer of abstraction as possible on top of the Dropbox Core API. Responses are returned as maps and use the same field names as the API itself to keep things simple.
UNDER DEVELOPMENT, NOT READY FOR PRODUCTION USE! Contributions welcome :)
## Usage
```iex
iex> Dropbox.start
:ok
iex> client = %Dropbox.Client{access_token: "WAAAwaaaWAAAWaaaaWaaWaaa..."}
%Dropbox.Client{access_token: "WAAAwaaaWAAAWaaaaWaaWaaa...",
client_id: nil, client_secret: nil, locale: nil, root: :dropbox}
iex> Dropbox.account_info! client
%Dropbox.Account{country: "US", display_name: "Amir Malik", email: "[email protected]",
quota_info: %{normal: 0, quota: 2952790016, shared: 21122088},
referral_link: "https://db.tt/uLPPUkc", team: nil, uid: 31337}
iex> Dropbox.mkdir! client, "secrets"
true
iex> Dropbox.upload_file! client, "/etc/passwd", "secrets/lol"
%Dropbox.Metadata{bytes: 5253, client_mtime: "Thu, 01 May 2014 07:01:46 +0000",
contents: %{}, hash: nil, icon: "page_white", is_deleted: false, is_dir: false,
modified: "Thu, 01 May 2014 07:01:46 +0000", path: "/secrets/lol",
photo_info: %Dropbox.Metadata.Photo{lat_long: [], time_taken: nil},
rev: "6800b928df", size: "5.1 KB", thumb_exists: false,
video_info: %Dropbox.Metadata.Video{duration: 0, lat_long: [], time_taken: nil}}
```Nearly all functions have bang (!) equivalents, which raise exceptions on errors instead of returning `{:error, reason}` tuples.