box_auth serves two purposes:
Setting up box.com accounts with
boxr for the first time
Connecting to previously used box.com accounts
In either case, it should be sufficient to run
box_auth() with no
parameters. If you've authenticated with boxr before, this should be all
that is required. However, the first time you use boxr, the process is
slightly more involved (see 'Getting Set-Up' below).
Optional. The client id for the account you'd like to use.
Optional. The client secret for the account you'd like
TRUE if connection successful, throws an error
otherwise. Invoked for it's side effect; OAuth2.0 connection to the
client_secret will be written to
~/.Renviron for future use, and a token object will be wrttien to
the path supplied bu
~/.boxr-oauth by default).
oauth2.0_token for details.
A version of this guide is in the package vignette, with some additional
screenshots. To view the vignette, run
To use boxr for the first time, you need to enable API access for your box.com account. The process is slightly annoying. You only need to do it once - it takes around 2 minutes.
The next time you use boxr, you should be able to just run
box_auth() (without entering anything else) to be authenticated and
At https://www.box.com/developers, click on 'My Apps', in the top right hand corner log in and create a new 'app' for your box.com account. This won't create an app of any description; you'll simply be granting yourself programmatic access to your files. You can call it anything you like.
On the next screen, you'll want to check the box for Content API
Access Only, and enter
http://localhost as your
box_auth() and pass your
client_secret to the console when prompted. These strings are
not' enough for someone to access your account maliciously. However,
it's still a good idea to keep them safe, and out of any files or code
which might be shared with others.
A browser window should open, for you to formally grant yourself access to your files at box.com.
From this point on, simply running
box_auth() at the start of a
session should be all that is required.
Brendan Rocks [email protected]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.