At Box, we strive to make it ridiculously easy for you to create amazing apps. We are continuously looking for ways to make your experience developing with Box more simple.
As a part of this effort, we're excited to announce a new endpoint in our Content API to bring the same preview experience
available in the Box apps to your apps. Now, you can get a preview link of a file stored in Box using the Content API and embed it in your app. You can learn more about the new endpoint in our documentation
The new preview capability via the Content API allows you to render files stored in Box to your users without having to use an additional API. This is the first step in our journey to create a single Box API to power all the amazing content services in your apps, instead of requiring developers to use separate Box APIs. Now, the Content API allows you to do more than just manage and share files; you can offer users a way to experience that content right in your apps.
Using our Content API, you can make a simple API request to retrieve an expiring URL to create an embedded preview session. The request will return an "expiring_embed_link" field, so long as the file ID is valid and if the user has access to the file. The "expiring_embed_link" field is a JSON object with another field called "url." Inside of the "url" field, you'll find the link to use in an embedded iframe to provide a rendering of the file to the user.
The new preview endpoint supports these document types.
For mobile apps, the Box Preview SDKs for iOS and Android leverage the Content API to allow you to easily create a preview experience in your iOS and Android apps. You can check out all our Mobile SDKs here.
We welcome your feedback as we strive to make your life easier when developing with Box. You can reach us on Twitter at @BoxPlatform or email us.
We can't wait to see what you build.