Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

box_view

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

box_view

  • 0.0.6
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

BoxView

A ruby client for Box's View API.

Installation

Add this line to your application's Gemfile:

gem 'box_view'

And then execute:

$ bundle

Or install it yourself as:

$ gem install box_view

Usage

Configure with your Box View API key.

BoxView::Session.config do |config|
  config.box_view_token = YOUR_API_KEY
end

Or configure a session and pass it to the API when you instatiate it.

session = BoxView::Session.new(token: YOUR_API_KEY)
BoxView::Api::Document.new(session)

Upload a document at a url.

doc = BoxView::Api::Document.new.upload("http://www.example.com/myfile.pdf", "My File")

Check the document's status. When it is "done", you're ready to generate a viewing session.

doc = doc.reload
if doc.status == "done"
  document_session = doc.document_session
  view_url = document_session.view_url
end

Remove the document from Box View.

doc.destroy

List all of your Box View documents.

docs = BoxView::Api::Document.new.list

Generate a thumbnail of a document

f = File.open("myfile.pdf", 'w')
f.write(doc.thumbnail(100, 100))
f.flush
f.close

Download the conents in pdf or zip format

f = File.open("myfile.pdf", 'w')
f.write(doc.content("pdf"))
f.flush
f.close

Contributing

  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

FAQs

Package last updated on 01 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc