Soenneker.Box.OpenApiClient
11.0.96
Prefix Reserved
dotnet add package Soenneker.Box.OpenApiClient --version 11.0.96
NuGet\Install-Package Soenneker.Box.OpenApiClient -Version 11.0.96
<PackageReference Include="Soenneker.Box.OpenApiClient" Version="11.0.96" />
<PackageVersion Include="Soenneker.Box.OpenApiClient" Version="11.0.96" />
<PackageReference Include="Soenneker.Box.OpenApiClient" />
paket add Soenneker.Box.OpenApiClient --version 11.0.96
#r "nuget: Soenneker.Box.OpenApiClient, 11.0.96"
#:package Soenneker.Box.OpenApiClient@11.0.96
#addin nuget:?package=Soenneker.Box.OpenApiClient&version=11.0.96
#tool nuget:?package=Soenneker.Box.OpenApiClient&version=11.0.96
Soenneker.Box.OpenApiClient
A Kiota-generated .NET client for the Box API, built from Box's OpenAPI description.
Installation
dotnet add package Soenneker.Box.OpenApiClient
Recommended setup
For dependency injection, token configuration, and client reuse, install the companion utility:
dotnet add package Soenneker.Box.OpenApiClientUtil
using Microsoft.Extensions.DependencyInjection;
using Soenneker.Box.OpenApiClientUtil.Registrars;
services.AddBoxOpenApiClientUtilAsSingleton();
Configure the Box access token under Box:ApiKey, then inject IBoxOpenApiClientUtil and call Get to obtain the generated client.
Direct construction
Use Kiota's request adapter when constructing the generated client yourself:
using System.Net.Http.Headers;
using Microsoft.Kiota.Abstractions.Authentication;
using Microsoft.Kiota.Http.HttpClientLibrary;
using Soenneker.Box.OpenApiClient;
using Soenneker.Box.OpenApiClient.Models;
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", accessToken);
var authentication = new AnonymousAuthenticationProvider();
var adapter = new HttpClientRequestAdapter(
authentication,
httpClient: httpClient);
var box = new BoxOpenApiClient(adapter);
UserFull? currentUser = await box.Users.Me.GetAsync(
request =>
{
request.QueryParameters.Fields = ["id", "name", "login"];
},
cancellationToken);
AnonymousAuthenticationProvider is appropriate in this example because the bearer header is already applied to the dedicated HttpClient. Do not use an unauthenticated shared client that can send its default authorization header to unrelated hosts.
Navigating the API
The client mirrors the Box API path hierarchy through request builders:
box.Users.Metargets/users/me.box.Files[fileId]targets a file by ID.box.Folders[folderId]targets a folder by ID.box.Searchexposes search operations.box.Events,box.Webhooks, and the other root properties expose their corresponding Box resources.
Endpoint methods accept a request-configuration callback for query parameters, headers, and middleware options, followed by a cancellation token.
Practical notes
- Keep the
HttpClient, request adapter, and generated client long-lived. The companion utility manages that lifecycle for dependency-injection applications. - Response models and endpoint return values may be nullable when the schema allows an empty response. Check the result before dereferencing it.
- Some endpoints return streams. Dispose those streams after consuming them.
- Kiota surfaces service failures through generated error models or Kiota exceptions, depending on the endpoint's schema mapping.
- Public type and property names follow the source OpenAPI description. Regeneration can add, rename, or remove generated members when that description changes.
- Files under
src/Soenneker.Box.OpenApiClientare generated. Put application-specific behavior in a separate project rather than editing generated request builders or models. - Treat Box access tokens as credentials and never include them in logs, exception messages, or source control.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Microsoft.Kiota.Http.HttpClientLibrary (>= 2.2.0)
- Microsoft.Kiota.Serialization.Form (>= 2.2.0)
- Microsoft.Kiota.Serialization.Json (>= 2.2.0)
- Microsoft.Kiota.Serialization.Multipart (>= 2.2.0)
- Microsoft.Kiota.Serialization.Text (>= 2.2.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Box.OpenApiClient:
| Package | Downloads |
|---|---|
|
Soenneker.Box.OpenApiClientUtil
A thread-safe utility for obtaining Box's OpenApiClient singleton. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.96 | 56 | 12/3/2026 |
| 11.0.95 | 83 | 12/2/2026 |
| 11.0.94 | 58 | 12/2/2026 |
| 11.0.93 | 152 | 11/30/2026 |
| 11.0.92 | 165 | 11/24/2026 |
| 11.0.91 | 111 | 11/20/2026 |
| 11.0.90 | 128 | 11/18/2026 |
| 11.0.88 | 146 | 11/18/2026 |
| 11.0.87 | 105 | 11/17/2026 |
| 11.0.86 | 104 | 11/17/2026 |
| 11.0.85 | 91 | 11/17/2026 |
| 11.0.84 | 133 | 11/14/2026 |
| 11.0.83 | 111 | 11/12/2026 |
| 11.0.82 | 129 | 11/11/2026 |
| 11.0.81 | 131 | 11/10/2026 |
| 11.0.80 | 121 | 11/4/2026 |
| 11.0.79 | 125 | 11/3/2026 |
| 11.0.78 | 145 | 11/3/2026 |
| 11.0.77 | 114 | 11/2/2026 |
| 11.0.76 | 124 | 11/2/2026 |
Update Soenneker.Box.OpenApiClient