Soenneker.Box.OpenApiClientUtil
11.0.282
Prefix Reserved
dotnet add package Soenneker.Box.OpenApiClientUtil --version 11.0.282
NuGet\Install-Package Soenneker.Box.OpenApiClientUtil -Version 11.0.282
<PackageReference Include="Soenneker.Box.OpenApiClientUtil" Version="11.0.282" />
<PackageVersion Include="Soenneker.Box.OpenApiClientUtil" Version="11.0.282" />
<PackageReference Include="Soenneker.Box.OpenApiClientUtil" />
paket add Soenneker.Box.OpenApiClientUtil --version 11.0.282
#r "nuget: Soenneker.Box.OpenApiClientUtil, 11.0.282"
#:package Soenneker.Box.OpenApiClientUtil@11.0.282
#addin nuget:?package=Soenneker.Box.OpenApiClientUtil&version=11.0.282
#tool nuget:?package=Soenneker.Box.OpenApiClientUtil&version=11.0.282
Soenneker.Box.OpenApiClientUtil
Provides an authenticated, cached instance of the Kiota-generated Box API client.
Installation
dotnet add package Soenneker.Box.OpenApiClientUtil
Configuration
{
"Box": {
"ApiKey": "<Box access token>",
"ClientBaseUrl": "https://api.box.com/2.0",
"AuthHeaderName": "Authorization",
"AuthHeaderValueTemplate": "Bearer {token}"
}
}
Only Box:ApiKey is required. The other values show their defaults. {token} in the header template is replaced with the configured token.
Store the token in a secret provider rather than source control or a checked-in settings file.
Registration
using Microsoft.Extensions.DependencyInjection;
using Soenneker.Box.OpenApiClientUtil.Registrars;
services.AddBoxOpenApiClientUtilAsSingleton();
Use AddBoxOpenApiClientUtilAsScoped() when each dependency-injection scope should own an isolated generated client, request adapter, and HTTP-client cache entry.
Usage
using Soenneker.Box.OpenApiClient.Models;
using Soenneker.Box.OpenApiClientUtil.Abstract;
public sealed class BoxProfileService
{
private readonly IBoxOpenApiClientUtil _boxClients;
public BoxProfileService(IBoxOpenApiClientUtil boxClients)
{
_boxClients = boxClients;
}
public async ValueTask<UserFull?> GetCurrentUser(
CancellationToken cancellationToken)
{
var box = await _boxClients.Get(cancellationToken);
return await box.Users.Me.GetAsync(
request =>
{
request.QueryParameters.Fields = ["id", "name", "login"];
},
cancellationToken);
}
}
Access other resources through the generated request-builder hierarchy, such as box.Files[fileId], box.Folders[folderId], box.Search, and box.Events.
Lifecycle and behavior
- The first
Getcreates the HTTP client, Kiota request adapter, and generated client. Later calls on the same utility return that client. - Configuration is captured during first initialization. Rotate a token by replacing the owning dependency-injection scope or application instance.
- The token passed to
Getcancels initialization only. Pass a cancellation token to each generated endpoint call as well. - Let dependency injection dispose
IBoxOpenApiClientUtil. Disposal releases its request adapter and, for scoped registration, its isolated HTTP-client entry. - Generated endpoint methods can return
nullwhen the Box schema permits an empty response. - Service errors are surfaced through generated error models or Kiota exceptions according to the endpoint mapping.
- The generated client follows Box's OpenAPI description, so its public request builders and models can change when the client package is regenerated.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Box.HttpClients (>= 11.0.200)
- Soenneker.Box.OpenApiClient (>= 11.0.96)
- Soenneker.Kiota.GenericAuthenticationProvider (>= 11.0.65)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.282 | 46 | 12/3/2026 |
| 11.0.281 | 50 | 12/3/2026 |
| 11.0.280 | 51 | 12/3/2026 |
| 11.0.279 | 52 | 12/3/2026 |
| 11.0.278 | 58 | 12/3/2026 |
| 11.0.277 | 53 | 12/3/2026 |
| 11.0.275 | 49 | 12/2/2026 |
| 11.0.274 | 52 | 12/2/2026 |
| 11.0.272 | 46 | 12/2/2026 |
| 11.0.270 | 58 | 12/2/2026 |
| 11.0.269 | 52 | 12/1/2026 |
| 11.0.268 | 58 | 12/1/2026 |
| 11.0.267 | 56 | 12/1/2026 |
| 11.0.266 | 55 | 12/1/2026 |
| 11.0.265 | 57 | 12/1/2026 |
| 11.0.264 | 56 | 12/1/2026 |
| 11.0.263 | 59 | 11/30/2026 |
| 11.0.262 | 95 | 11/30/2026 |
| 11.0.261 | 98 | 11/30/2026 |
| 11.0.260 | 94 | 11/29/2026 |
Updated Multiple NuGet packages