Box Platform provides functionality to provide access to content stored within Box. It provides endpoints for basic manipulation of files and folders, management of users within an enterprise, as well as more complex topics such as legal holds and retention policies.
Package
octri_box_platform:octri_box_platform· Version1.0.0· 297 operations
Install the delivered checkout into your local Maven repository:
mvn installThen add the dependency:
<dependency>
<groupId>octri_box_platform</groupId>
<artifactId>octri_box_platform</artifactId>
<version>1.0.0</version>
</dependency>The example calls get_ai_agents (GET /ai_agents), a low-friction operation that requires no request arguments.
import octri_box_platform.*;
public final class Example {
public static void main(String[] args) throws Exception {
var config = new SdkConfig.ClientConfig();
config.baseUrl = "https://api.box.com/2.0";
var auth = new SdkConfig.ClientAuthConfig();
var oauth = new SdkConfig.OAuth2Auth();
oauth.accessToken = System.getenv("API_TOKEN");
auth.oAuth2Security = oauth;
config.auth = auth;
var client = new BoxPlatform(config);
var result = client.aIStudio.getAiAgents();
System.out.println(result);
}
}Keep credentials outside source control. The quickstart reads them from the environment and the client applies them to every request.
| Scheme | ClientAuthConfig field | Sent as |
|---|---|---|
| OAuth2Security | oAuth2Security |
OAuth 2 access token |
- Base URL:
https://api.box.com/2.0. - Transport: java.net.http.HttpClient.
- Timeout: 30,000 ms per attempt.
- Retries: up to 3 attempts for status codes
408,425,429,500,502,503,504, with 500–8,000 ms backoff. - Idempotency: disabled.
- Error telemetry is disabled by default, even when a reporting endpoint is baked into the build. Consumers must opt in explicitly.
- Telemetry PII filtering is enabled by default: common credentials and direct identifiers are recursively replaced with
[REDACTED]before reports are sent. Disable it only through the generated logging config'sfilterPii(or language-native equivalent) for a trusted private sink.
High-level operation methods return the typed response body directly. The low-level request layer returns an SdkResponse<T> envelope containing data, status, headers, request ID, latency, and attempt count.
All failure paths use a small, predictable hierarchy:
| Error | Meaning |
|---|---|
SdkValidationError |
A request argument failed an OpenAPI constraint before network I/O. |
SdkHttpError |
The server returned a non-2xx response. |
SdkNetworkError |
DNS, connection, TLS, or socket failure. |
SdkTimeoutError |
The configured per-attempt timeout elapsed. |
HTTP errors expose statusCode, the response body and headers, plus requestId when the server supplies one. Preserve the request ID in support logs; it is the fastest way to correlate a failed SDK call with server-side traces.
- Operation implementations are grouped under
src/main/java/octri_box_platform/methods/. - 310 component models are split by API domain under
src/main/java/octri_box_platform/models/<domain>/<Type>.javaormodels/<tag path>/<Type>.java. - Component schemas can choose a nested model folder with
x-octri-sdk-tags: ["Billing/Invoices"]; the first tag owns the model and/creates nesting. sdk-manifest.jsonis the language-neutral public API index: operations, request/response modes, model properties, enum values, and generation settings.- Models are public from their domain packages; import them as
octri_box_platform.models.<domain>.<Type>.
Generated SDK includes schema-derived, zero-dependency mock server and network contract suite. Node.js 20+ required. Contract probes use authored response examples only; schema-synthesized routes remain available to the local server.
./scripts/mock --port 4010 starts server. ./scripts/test runs the mock contract suite, then native SDK tests. A zero-authored-example contract run succeeds with an explicit zero-test
summary; mismatches in authored examples still fail.