Soenneker.Box.OpenApiClient 11.0.78

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Box.OpenApiClient --version 11.0.78
                    
NuGet\Install-Package Soenneker.Box.OpenApiClient -Version 11.0.78
                    
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.OpenApiClient" Version="11.0.78" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Box.OpenApiClient" Version="11.0.78" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Box.OpenApiClient" />
                    
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.OpenApiClient --version 11.0.78
                    
#r "nuget: Soenneker.Box.OpenApiClient, 11.0.78"
                    
#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.OpenApiClient@11.0.78
                    
#: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.OpenApiClient&version=11.0.78
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Box.OpenApiClient&version=11.0.78
                    
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.OpenApiClient

A Kiota-generated .NET client for the Box API, built from Box's OpenAPI description.

Installation

dotnet add package Soenneker.Box.OpenApiClient

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.

The client mirrors the Box API path hierarchy through request builders:

  • box.Users.Me targets /users/me.
  • box.Files[fileId] targets a file by ID.
  • box.Folders[folderId] targets a folder by ID.
  • box.Search exposes 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.OpenApiClient are 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 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 (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 63 12/3/2026
11.0.95 91 12/2/2026
11.0.94 62 12/2/2026
11.0.93 156 11/30/2026
11.0.92 166 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 106 11/17/2026
11.0.86 105 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
Loading failed

Update Soenneker.Box.OpenApiClient