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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Box.OpenApiClientUtil" Version="11.0.282" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Box.OpenApiClientUtil" Version="11.0.282" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Box.OpenApiClientUtil" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Box.OpenApiClientUtil --version 11.0.282
                    
#r "nuget: Soenneker.Box.OpenApiClientUtil, 11.0.282"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Box.OpenApiClientUtil@11.0.282
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Box.OpenApiClientUtil&version=11.0.282
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Box.OpenApiClientUtil&version=11.0.282
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 Get creates 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 Get cancels 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 null when 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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

Updated Multiple NuGet packages