0

from a quick review of their documentation, it appears that the box.com api is geared towards writing applications to allow users to log in and interact with their own box accounts.

I want a user of my website to be able to view documents that I have placed in a shared folder in my own box account. I know, this sounds like what can be done with with the box.com widget, but I'd like to be able to do this with more flexibility. i'd like to be able to change the look of it and add the ability for users to search or sort etc.

Is there a way to do this with the box api? Really the only thing I'd need to be able to make this work, is to retrieve a list of document names/details and links to these documents.

benino
  • 577
  • 2
  • 6
  • 16

1 Answers1

1

Benino, I think that this is possible. Two things are required to view any user's Box content: an API key and an authorization token. You get the API key by creating a Box app. You then get an authorization token by going through Box's authentication workflow . Keep these values secret and safe.

Once you have those two values, then you should simply be able to call into the API and fetch your particular folder's items. You will need to know the folder's ID, which can be determined by browsing to that folder in the web browser and looking at the URL. The ID is a numeric string.

All of this assumes that your intent is to do all of the UI/styling/searching/sorting pieces yourself, per the last sentence of your question.

John Hoerr
  • 7,955
  • 2
  • 30
  • 40
  • Thanks for the reply, but the "authentication workflow" is what I was hoping to avoid. It seems to require a redirect from my site to a box.com login page where the user enters their credentials. I'm just trying to expose content from a folder on my box account that I have shared with everyone. I don't want to require users to log in or to have to have a box.com account. – benino Nov 13 '12 at 22:28
  • If I'm reading you right, none of your users would have to go through the authorization workflow. Since it's your account and content you could simply get an authorization token for yourself and use it for the requests. The token doesn't expire so you can save and reuse it in whatever way is easiest for you. – John Hoerr Nov 14 '12 at 00:41
  • Update: the auth token now expires after an hour now, but it can be refreshed indefinitely. – John Hoerr Feb 01 '13 at 13:44
  • How does one go about getting the auth token initially? – benino Feb 11 '13 at 23:04
  • Check out this [OAuth 2.0 Walkthrough](http://developers.box.com/oauth/) -- it shows you the whole process. – John Hoerr Feb 16 '13 at 23:26