Soenneker.Bandwidth.OpenApiClientUtil
4.0.194
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Bandwidth.OpenApiClientUtil --version 4.0.194
NuGet\Install-Package Soenneker.Bandwidth.OpenApiClientUtil -Version 4.0.194
<PackageReference Include="Soenneker.Bandwidth.OpenApiClientUtil" Version="4.0.194" />
<PackageVersion Include="Soenneker.Bandwidth.OpenApiClientUtil" Version="4.0.194" />
<PackageReference Include="Soenneker.Bandwidth.OpenApiClientUtil" />
paket add Soenneker.Bandwidth.OpenApiClientUtil --version 4.0.194
#r "nuget: Soenneker.Bandwidth.OpenApiClientUtil, 4.0.194"
#:package Soenneker.Bandwidth.OpenApiClientUtil@4.0.194
#addin nuget:?package=Soenneker.Bandwidth.OpenApiClientUtil&version=4.0.194
#tool nuget:?package=Soenneker.Bandwidth.OpenApiClientUtil&version=4.0.194
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Bandwidth.HttpClients (>= 4.0.125)
- Soenneker.Bandwidth.OpenApiClient (>= 4.0.87)
- Soenneker.Kiota.GenericAuthenticationProvider (>= 4.0.46)
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 |
|---|---|---|
| 4.0.209 | 0 | 9/26/2026 |
| 4.0.208 | 0 | 9/26/2026 |
| 4.0.207 | 0 | 9/26/2026 |
| 4.0.206 | 28 | 9/25/2026 |
| 4.0.205 | 30 | 9/25/2026 |
| 4.0.204 | 32 | 9/24/2026 |
| 4.0.203 | 86 | 9/18/2026 |
| 4.0.202 | 94 | 9/17/2026 |
| 4.0.201 | 94 | 9/17/2026 |
| 4.0.200 | 86 | 9/16/2026 |
| 4.0.199 | 88 | 9/16/2026 |
| 4.0.198 | 86 | 9/16/2026 |
| 4.0.197 | 90 | 9/16/2026 |
| 4.0.196 | 86 | 9/16/2026 |
| 4.0.195 | 83 | 9/15/2026 |
| 4.0.194 | 82 | 9/15/2026 |
| 4.0.193 | 91 | 9/13/2026 |
| 4.0.192 | 85 | 9/13/2026 |
| 4.0.191 | 91 | 9/13/2026 |
| 4.0.190 | 96 | 9/12/2026 |