Joel
Joel

Reputation: 2688

Application Folder for Box.net

For dropbox, we use an "application folder" where docs are placed for our application. When authenticated, we only see files for that folder. What is the equivalent with Box.net?

Looking at the (Java) API, it seems that the only choice is to look through all the files on their drive.

Upvotes: 0

Views: 133

Answers (2)

Greg
Greg

Reputation: 3741

John's answer is correct that Provision Grant is the way to go about doing this. As for the Java SDK, it unfortunately doesn't support the provisioning auth workflow yet (this is a feature we're looking to add).

However, if you are able to do provisioning authentication manually, you can hand off your access/refresh tokens to the SDK and then use it normally.

BoxAPIConnection api = new BoxAPIConnection("clientID", "clientSecret",
    "accessToken", "refreshToken");

// You can also set the expiration time if you want the SDK to auto-
// refresh your access token for you.
api.setExpires(expires); 

// Your application's folder will be returned after you authenticate
// with provision grant.
String appFolderID = "id";

BoxFolder appFolder = new BoxFolder(api, appFolderID);
for (BoxItem.Info itemInfo : appFolder) {
    // Do something with the items in your app's folder.
}

Apologies that this isn't very intuitive. I created an issue for adding better provision grant support to the SDK.

Upvotes: 0

John Hoerr
John Hoerr

Reputation: 8035

Check out the Provision Grant workflow. Given an email address Box will add a sandboxed application folder to the user's account, creating the account as necessary.

Upvotes: 2

Related Questions