Soenneker.Bandwidth.OpenApiClientUtil 11.0.257

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

Creates and caches an authenticated BandwidthOpenApiClient for dependency-injected applications.

Installation

dotnet add package Soenneker.Bandwidth.OpenApiClientUtil

Configuration

{
  "Bandwidth": {
    "ApiKey": "your-token",
    "ClientBaseUrl": "https://api.bandwidth.com/api/v2/",
    "AuthHeaderName": "Authorization",
    "AuthHeaderValueTemplate": "Bearer {token}"
  }
}

Bandwidth:ApiKey is required; the other values shown are defaults. Set the header template to the authentication scheme required by the Bandwidth service you call. For an already Base64-encoded Basic credential, use Basic {token}.

This utility configures one base URL and one authentication header. Bandwidth endpoints requiring another host, a different credential set, or multiple authentication headers should use a separately configured generated client.

Registration

using Soenneker.Bandwidth.OpenApiClientUtil.Registrars;

services.AddBandwidthOpenApiClientUtilAsScoped();

The scoped utility uses a singleton HTTP-client provider. Ending a scope disposes that utility's generated client state but leaves the singleton provider and its HttpClient alive. Use AddBandwidthOpenApiClientUtilAsSingleton() when the generated client should also be shared application-wide.

Usage

using Soenneker.Bandwidth.OpenApiClient;
using Soenneker.Bandwidth.OpenApiClient.Models;
using Soenneker.Bandwidth.OpenApiClientUtil.Abstract;

public sealed class BandwidthMessageService
{
    private readonly IBandwidthOpenApiClientUtil _clientUtil;

    public BandwidthMessageService(IBandwidthOpenApiClientUtil clientUtil)
    {
        _clientUtil = clientUtil;
    }

    public async Task<MessagesList?> GetMessages(string accountId, CancellationToken cancellationToken = default)
    {
        BandwidthOpenApiClient client = await _clientUtil.Get(cancellationToken);
        return await client.Messaging.Users[accountId].Messages.GetAsync(cancellationToken: cancellationToken);
    }
}

Get() lazily creates one generated client per utility instance and returns it afterward. Authentication and base-address configuration are captured during initial creation. Credentials are added only to HTTPS requests and are pinned to the first request host.

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.269 73 11/5/2026
11.0.268 76 11/3/2026
11.0.266 80 11/3/2026
11.0.265 78 11/3/2026
11.0.264 79 11/3/2026
11.0.263 76 11/3/2026
11.0.262 78 11/3/2026
11.0.261 74 11/3/2026
11.0.260 95 11/2/2026
11.0.259 95 11/2/2026
11.0.258 92 11/2/2026
11.0.257 97 10/31/2026
11.0.256 102 10/31/2026
11.0.255 99 10/30/2026
11.0.254 101 10/29/2026
11.0.253 96 10/28/2026
11.0.252 97 10/27/2026
11.0.251 102 10/27/2026
11.0.250 92 10/27/2026
11.0.249 98 10/27/2026
Loading failed

Updated Soenneker.Bandwidth.OpenApiClient to 11.0.120