SDKs overview

Box provides a suite of Software Development Kits (SDKs) designed to simplify integration with its Content Cloud and Platform services. These SDKs abstract much of the complexity of direct API interactions, allowing developers to focus on application logic rather than HTTP request construction, authentication flows, or error handling. Box SDKs are available for a range of programming languages and platforms, catering to both server-side and client-side application development needs Box developer guides.

The SDKs are built to facilitate common operations such as uploading and downloading files, managing users and groups, configuring webhooks for event notifications, and interacting with Box Skills. By providing native language constructs and object-oriented interfaces, they aim to reduce development time and improve code maintainability for applications leveraging Box's capabilities. Beyond official SDKs, the Box ecosystem also includes community-contributed libraries and connectors.

Official SDKs by language

Box maintains official SDKs for several popular programming languages and platforms. These SDKs are actively developed and supported, ensuring compatibility with the latest Box API versions and features. Each SDK provides a consistent interface to the Box API, adhering to language-specific conventions and best practices.

The following table lists the official Box SDKs, along with their primary package names, installation commands, and general maturity level:

Language/Platform Package Name Install Command (Example) Maturity
Python boxsdk pip install boxsdk Stable, Actively Maintained
Node.js box-node-sdk npm install box-node-sdk Stable, Actively Maintained
.NET (C#) Box.V2 Install-Package Box.V2 (NuGet) Stable, Actively Maintained
Java box-java-sdk Maven/Gradle dependency Stable, Actively Maintained
iOS (Swift/Objective-C) BoxContentSDK CocoaPods/Swift Package Manager Stable, Actively Maintained
Android (Java/Kotlin) box-android-sdk Gradle dependency Stable, Actively Maintained

Installation

Installing a Box SDK typically involves using the standard package manager for the respective programming language or platform. The process is designed to be straightforward, allowing developers to quickly set up their development environment.

Python SDK Installation

To install the Box Python SDK, use pip, the Python package installer:

pip install boxsdk

For detailed instructions and prerequisites, refer to the Box Python SDK documentation.

Node.js SDK Installation

For Node.js projects, the Box SDK can be installed via npm:

npm install box-node-sdk

Further setup and usage examples are available in the Box Node.js SDK guide.

.NET SDK Installation

Developers working with .NET can install the Box SDK using NuGet Package Manager:

Install-Package Box.V2

Comprehensive guides for .NET integration can be found in the Box .NET SDK documentation.

Java SDK Installation

For Java applications, the Box SDK is typically managed through Maven or Gradle. Add the appropriate dependency to your pom.xml (Maven) or build.gradle (Gradle) file. Here's an example for Maven:

<dependency>
    <groupId>com.box</groupId>
    <artifactId>box-java-sdk</artifactId>
    <version>X.Y.Z</version> <!-- Replace with the latest version -->
</dependency>

Consult the Box Java SDK setup instructions for the latest version and Gradle examples.

iOS SDK Installation

The Box iOS SDK supports CocoaPods and Swift Package Manager. Using CocoaPods:

pod 'BoxContentSDK'

Refer to the Box iOS SDK installation guide for detailed steps and Swift Package Manager integration.

Android SDK Installation

For Android development, include the Box Android SDK as a Gradle dependency in your project's build.gradle file:

dependencies {
    implementation 'com.box:box-android-sdk:X.Y.Z' <!-- Replace with the latest version -->
}

Detailed setup information is available in the Box Android SDK documentation.

Quickstart example

This Python example demonstrates how to authenticate with the Box API using a developer token and retrieve information about the current user. This is a common first step when integrating with Box to confirm connectivity and authentication.

from boxsdk import Client, OAuth2

# Replace with your developer token from the Box Developer Console
DEVELOPER_TOKEN = 'YOUR_DEVELOPER_TOKEN'

# Initialize OAuth2 object with developer token
# For production, use client ID, client secret, and access/refresh tokens
oauth = OAuth2(
    client_id='YOUR_CLIENT_ID', # Not strictly needed for a developer token, but good practice
    client_secret='YOUR_CLIENT_SECRET', # Same as above
    access_token=DEVELOPER_TOKEN
)

# Initialize the Box client
client = Client(oauth)

# Get the current user's information
current_user = client.user().get_current_user()

print(f"Authenticated as: {current_user.name} (ID: {current_user.id})")
print(f"Login email: {current_user.login}")

# Example: List items in the root folder
root_folder = client.folder(folder_id='0').get()
print(f"\nItems in root folder '{root_folder.name}':")
for item in root_folder.get_items():
    print(f"  - {item.type.capitalize()}: {item.name} (ID: {item.id})")

This example uses a developer token for simplicity in a quickstart. For production applications, Box recommends using OAuth 2.0 with a proper client ID, client secret, and refresh tokens for secure, long-lived access. More information on authentication methods can be found in the Box OAuth 2.0 documentation.

Community libraries

While Box provides officially supported SDKs, the broader developer community has also contributed various tools and libraries that extend Box's capabilities or offer integrations in languages not officially supported. These community-driven projects can provide alternative approaches or specific functionalities not covered by the official SDKs.

Examples of community contributions often include:

  • PowerShell Modules: For scripting and automation within Windows environments.
  • GoLang Libraries: Enabling Box API interactions for applications written in Go.
  • CLI Tools: Command-line interfaces built on top of Box APIs for administrative tasks.
  • Connectors: Integrations with specific third-party systems or frameworks not natively supported by official SDKs.

Developers should exercise diligence when using community-supported libraries, as their maintenance, security, and compatibility with the latest Box API versions may vary. It is recommended to check the project's activity, documentation, and community support before incorporating them into critical applications. Platforms like GitHub are common repositories for such projects, where developers can find and contribute to open-source initiatives related to Box GitHub documentation.

For a comprehensive list of community resources and tools, developers can explore the Box Developer Portal's community section, which often highlights popular or useful projects. Engaging with the Box developer forum can also provide insights into widely adopted community solutions and best practices.