OpenBox Developers Blog

More support for iPhone integration with Box

The iPhone is a powerful platform for creating content, viewing files and communicating with friends and associates. One of the big problems we’ve seen, however, is that it’s difficult to share documents with others from the phone. Many solutions exist but they require large amounts of custom code, building or configuring server components, or using confusing API’s.

We want it to be as easy as possible for developers to build applications that can upload, download and share files from the mobile phone. Today we’re introducing two code libraries that developers can use to incorporate Box.net’s functionality into their iPhone applications.

The first set of code we’re introducing handles all of the basic calls to the Box server including Login, Registration, GetAccountTree, Share and Upload and even parses and returns these calls as Objective-C objects. To access it, go to http://developers.box.net/ApiExamples and download the zip file in the Objective-C folder.

The second set of code we’re introducing is a subclass of UIViewController - BoxPopupController. It provides a user interface that handles all of the tasks of registration/login, folder selection, upload and sharing. The BoxPopupController can be presented as a modal view controller. It saves the user’s account name and authentication token, preferred upload location, and even email addresses with which to share the newly uploaded file. With the BoxPopupController, all it takes to integrate Box into your application is allocation of a view controller and implementation of five simple delegate methods. You provide the data and Box takes care of the rest.

It’s easy to include either one of these sample libraries in your application. The full instructions are included with the code in the zip file, but I’ll give an overview of the process here.

The BoxSampleCode is split up into two logical folders: ‘Models’ and ‘Model Builders.’ Using classes in BoxSampleCode you can get a BoxUserModel containing the authentication token. With the authentication token, you can easily get a BoxFolderModel, which contains all of the contents of a particular folder.

+(BoxFolderModel*) getFolderForId:(NSNumber*)rootId andToken:(NSString*)token andResponsePointer:(BoxFolderDownloadResponseType*)response andBasePathOrNil:(NSIndexPath*)path;

Other useful functions include registration, uploading, and uploading and sharing.

The BoxPopup code is simple to include in your project - first create a button, then in the callback action create a BoxPopupController. Finally, set the delegate and popup the controller:

BoxPopupController * _boxPopupController;

_boxPopupController = [[BoxPopupController alloc] initWithNibName:@"BoxPopupController" bundle:nil];
_boxPopupController.popupDelegate = self;
[self presentModalViewController:_boxPopupController animated:YES];
[_boxPopupController release];

The BoxPopupController delegate needs to implement only five functions to render the BoxPopup. For example, this is how short the BoxPopupControllerDelegate code can be:

-(NSData*)data {
    return [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Simple Text Format" ofType:@"rtf"]];
}
-(NSString*)fileExtension {
    return @"rtf";
}
-(void)popupShouldExit {
    [self dismissModalViewControllerAnimated:YES];
}
-(NSString*)suggestedFileName {
    return @"notes";
}
-(BOOL)shouldAppendTimeAndDate {
    return YES;
}

That’s it. We are always striving to make our developers’ lives easier, and we hope this will make integrating Box into your iPhone applications a breeze.

Post by Michael Smith, Associate Product Manager, and Alex Willen, OpenBox Intern

Promoting Developers through the OpenBox Directory

While providing additional resources for mobile application developers, we realized that we needed to do more to promote the efforts of our development community, both for our partners who create OpenBox Actions and for individual developers who have created compelling and unique integrations.  Through a joint effort with engineering and marketing, we redesigned our OpenBox directory for a structure that encourages more users to see and try your applications.


Among the key enhancements, you’ll see:

  • OpenBox Actions and API Applications are displayed.  You no longer need to have an OpenBox Action to have your project listed in our directory.  We started listing new iPhone applications and widgets such as for LinkedIn and Salesforce.  If you have an application that you’d like to promote, please let us know!
  • Categorization - Users will now be able to more easily find the applications that suit their needs, and thus make your applications more visible to the users you want.
  • Highlighting new integrations - Users are now shown a listing of OpenBox applications to add, rather than the applications they are already using.  This gives your work a better opportunity to be seen.
  • Enhanced description page - With a new UI, including room for a more detailed description, more links to your site and support, and a clearer area for user feedback,  your application can make a better first impression.

We think this is a good start, but we will continue to tweak the UI, and have plenty more features planned to further promote everyone’s efforts (think in-site messaging).   Stay tuned for more marketing opportunities and developer resources from our OpenBox team.

Post by Jeremy Glassenberg, Platform Manager

Working with Mobile Developers: OpenBox Mobile

This month we have some great news for mobile app developers, and some more great news for all OpenBox developers. We recently launched OpenBox Mobile, a program geared to helping mobile applications interact with Box.  Through programming libraries, sample code, and recommended API methods to optimize calls, we look forward to providing mobile apps with access to the cloud for easy access and sharing.

After frequently talking with developers from all mobile platforms, we found a trend in the mobile market.  Many applications that rely on content, from voice recorders or document editors, to scanners and note takers, face a common challenge of bringing content into a mobile device, and sharing content off of the device.  Looking to go beyond desktop synchronization and emails, Box.net becomes a convenient alternative.  By leveraging the cloud, mobile apps can access content from anywhere, and easily transfer and share their content as well.

For iPhone developers, we have a new set of Objective-C code to get your apps working with the cloud quickly.  Additional resources will be provided for developers across all mobile platforms.

We especially appreciate the effort and initiative of the following mobile partners, who helped to test ourAPI and new mobile tools:

- iThoughts (mind-mapping)
- QuickOffice (document editing)
- iBlueSky (mind-mapping)
- Smart Recorder (audio recorder)
- iRec (audio recorder)
- JotNot (image and document archiving)
- mySticky (notes and to-do’s)
- Readdle (document access)
- Pixelpipe (document access)

We look forward to working with more of you on your own mobile programs!

And for all OpenBox developers, this month you’ll get to see some new changes to the development site and OpenBox directory, designed both to assist with development, and to better promote your work to Box.net customers (now approaching 3 million).  We’ll provide more information on these enhancements later, but for now you can look around the OpenBox directory and see these enhancements as they progress.

Getting started with OpenBox Actions

Many new platform partners are recently joining the OpenBox directory (with plenty more to come) by leveraging OpenBox Actions.  For those of you who are more familiar with the API than OpenBox Actions, Actions enable you to bring your own service’s functionality into the Box environment - a different direction from the API which brings Box.net features into your service or application.

You’ve probably previewed a document in Box in Scribd, or edited an image with Picnik, or shared a file through Twitter.  These are examples of OpenBox Actions, and they’re not just built by Box.net’s development team.  You can actually create your own OpenBox Action through our platform, and have the opportunity to promote your service to Box.net’s users.

A common interaction involves OpenBox-to-API integrations.  Because OpenBox Actions can make REST, SOAP, and XML-RPC calls, partner services easily connect their existing APIs to OpenBox with minimal or no additional coding, often in a day or less.  Other partners still find the platform to be simple and flexible, enabling them to integrate quickly, and even scale integrations into new, full APIs.

Since most of you already have an OpenBox service to use the Box API, it’s easy to start building an OpenBox Action.  Just create or edit an OpenBox service from your development page, and in your service’s settings, below your API key, you’ll see where to start creating OpenBox Actions.

We’re continuing to enhance the capabilities of OpenBox Actions along with our API, enabling a wider variety of services to work with OpenBox.  For instance, you may have noticed that Gmail, Twitter, and Fuze Meeting are now accessible in the sidebar of your folders as well as on your files.

Beta features such as folder-level actions can be made available to interested developers.  Just contact our team and we may provide you with OpenBox features in progress, offer extra assistance, and consider new platform enhancements to fit best with your ideas.

Post by Jeremy Glassenberg, Platform Manager

Send files to Box easily with Quick Import

The OpenBox platform is designed for incredible flexibility to let developers create the widest variety of integrations possible.  But we also notice trends among applications and like to help simplify those common tasks.  For instance, many services wish to transfer files to a user’s Box account often performing the same set of operations - authenticating the user, displaying the user’s account structure to select a folder, and then sending the file to the specified folder.

Today, we are pleased to announce a new API method to drastically simplify this popular use of the OpenBox API: Quick Import. This method helps developers to easily transfer content to a user’s Box.net account, through an API call as simple to create as an ordinary download link.

To use Quick Import, all you need to do is provide this tool with the URL of a file you want to send. Then direct your user to that URL, and let Box.net handle the rest - authentication, selecting the upload folder, etc.

image

With Quick Import, you can easily move content into to your user’s Box account for further collaboration and sharing.  As an example, you may want to try out Open IT Online, a popular Firefox extension that now lets you save what you find online straight to Box.

To get started, instructions are available on our documentation page.

Post by Jeremy Glassenberg, Platform Manager

New API Method: Copy

In another small enhancement from developer requests, we’re providing a new API method - copy.  This can be called similarly to the move method, by simply specifying which file you would like to copy, and to which folder.  That should help to further optimize code for many of your applications.

Some big enhancements are coming, so never hesitate to contact our developer team if you have any thoughts or requests.

Post by Jeremy Glassenberg, Platform Manager

More sample code for the API - Visual Basic

For our developers who expressed interest in creating some simple integrations with Box using Visual Basic, we have some helper code to offer, thanks to the efforts of David Roberts. You can download his basic sample code from our documentation page to get started.

David’s code can help you to get familiar with the basic methods of our API, such as the authentication process, downloading and uploading files, and viewing the structure of a user’s account tree. Just enter your own API key into the code (obtained when registering an OpenBox service), and you’ll have this simple, customizeable Visual Basic application running in no time.

Post by Jeremy Glassenberg, Platform Manager

API Update: Optimizing get_account_tree

Many of our more complex API methods are designed for flexibility, so that you can request exactly the content you need, and only the content you need.  For example, the get_account_tree method allows you to customize and optimize your request by specifying optional parameters.  If you just want to display a folder tree so that a user can select a folder, you can specify ‘nofiles’  in the API call in order to avoid receiving a full tree of the user’s files.  And many developers leverage our “onelevel” option to ignore the subfolders in an account hierarchy, be it to search for a file that they know is at the top of a folder, or to just speed up the display of a folder to their users by refraining from obtaining the subfolder content.

To further assist developers who just need to know what’s in the account tree, but don’t need to have every detail for each folder and file, we have a new optional parameter - ’simple.’  This allows you to obtain everything that is normally received from a call to ‘get_account_tree’, but doesn’t give every detail such as the time of a a file’s description, a folder’s sharing status, and other information of which many developers enjoy having access,  but which you may not need.

An ordinary get_account_tree call could inlcude a folder listing that looks something like this:

<folder id="4584" name="Sample folder" description="" user_id="3358104" shared="1"
shared_link="http://www.box.net/shared/im1n45dfe" permissions="denpsuv" size="156427"
file_count="1" created="1219270561" updated="1240208378">
  <tags/>
  <files>
    <file id="62787" file_name="silver.doc" keyword="" shared="0" size="15805"
    created="1129544520" updated="1129568520" sha1="..." description="" user_id="..."
    shared_link="http://www.box.net/..." thumbnail="http://www.box.net/..."
    small_thumbnail="http://www.box.net/..." large_thumbnail="http://www.box.net..."
    larger_thumbnail="http://www.box.net/..." preview_thumbnail="http://www.box.net/..."
    permissions="denpsuv">
      <tags>
        <tag id="35" />
      </tags>
    </file>
  </files>
</folder>

If you choose to specify “params[]=simple” you’ll be able to instead obtain a tree like this:

<folder id="4584" name="Sample Folder">
  <files>
    <file id="62787" file_name="silver.doc" size="15805"
    created="1129544520"></file>
  </files>
</folder>

This addition should be especially helpful for mobile applications that intend to display a full account tree but, rely on slower internet connections and have less screen space for which to display detailed content anyway.  You can now obtain the user’s account tree while leaving out a good chunk of data, saving time and resources for your users.

Thank you to the members of the development community who requested this small addition to our API.

Post by Jeremy Glassenberg, Platform Manager

New .NET library and C# code for the Box.net API

We are happy to provide our developers with a .NET library to make your development projects easier.  You can access this library by visiting the sample code section of our developer documentation.  The source code was written in C#, but the compiled library can be used with any .NET programming language.


This new library was created by Volodymyr Usarskyy, who put in a truly amazing effort to provide a detailed and easy-to-use library for .NET programmers of the Box.net API. Feel free to visit Volodymyr’s project’s site to obtain the most up-to-date version of his code, try the latest sample code for this library, and provide feedback as enhancements continue.

Post by Jeremy Glassenberg, Platform Manager

New API Method: get_account_info

After receiving feedback from members of our development community, we have decided to  provide a small platform enhancement for this week, introducing a new API method: get_account_info.

This new method provides basic information about an authenticated user such as the amount of space a user has left in one’s account.  The output provided by ‘get_account_info’ is in fact the same information that your programs obtain when authenticating users through the API, but now you can obtain the most up-to-date account information without having to repeat the API authentication process.  This should help to optimize the code for many of your applications.

Plenty of other enhancements are in progress, so please continue to inform us of your experiences with the Box API so that we can provide the best tools for you.

Post by Jeremy Glassenberg, Platform Manager