Skip to content
Ruby client for Egnyte's Public API.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore adding dependencies. Jul 9, 2013
README.markdown travis setup Feb 7, 2019


Ruby Egnyte

This SDK is no longer supported by Egnyte. It continues to be available as-is and pull requests will be merged, but no support will be provided.

A feature-rich Ruby client for the Egnyte API.

Special thanks to the folks at and Yesware, Inc. who got this library off to a great start.

Build Status


  • Create a session object with your Egnyte API Key
  • Create an authorize url and direct a user to it, to retrieve an access_token for their account.
require 'egnyte'

session ={
    key: 'api_key',
    domain: 'egnyte_domain'

# direct the user to the authorize URL generated,
# the callback provided will be executed with an access token.

  • Create a client, with the authenticated session.
@client =

The client initialized, we can start interacting with the Egnyte API.


  • Fetching a folder
folder = @client.folder('/Shared')
p # outputs 'Shared'.
  • Listing files in a folder.
@client.folder('/Shared/Documents/').files.each {|f| p}
# outputs "IMG_0440.JPG", "IMG_0431.JPG"
  • Creating a folder.
new_folder = @client.folder('/Shared/Documents/').create('banana')
p new_folder.path # a new folder was created /Shared/Documents/banana
  • Deleting a folder.
folder = @client.folder('/Shared/Documents/banana')


  • Fetching a file
file = @client.file('/Shared/example.txt')
p # example.txt.
  • Deleting a file.
  • Uploading a file.
local_path = "./LICENSE.txt"
filename = "LICENSE.txt"

folder = @client.folder('Shared/Documents/') local_path ) do |data|
 folder.upload(filename, data)
  • Downloading a file.
file = @client.file('/Shared/Documents/LICENSE.txt')

Rate limitations

There are rate limitations on a per-token basis in the Egnyte API: per second, and daily quota.

The library raises a Egnyte::RateLimitExceededPerSecond when you go over your alloted rate per second, and raises a Egnyte::RateLimitExceededQuota when you go over your alloted daily quota. Both exceptions contain a retry_after value.

You can also instantiate the session with the optional keyword variable retries: 5 e.g.:

session =
           {access_token: 'secret-token', domain: 'egnyte_domain', username: 'me'}, 
           :implicit, # or :password for internal apps 
           0.0, # backoff of 0 makes sense if you are retrying 
           retries: 5)


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
You can’t perform that action at this time.