Connectwise.SDK.v2025.1
1.0.1
dotnet add package Connectwise.SDK.v2025.1 --version 1.0.1
NuGet\Install-Package Connectwise.SDK.v2025.1 -Version 1.0.1
<PackageReference Include="Connectwise.SDK.v2025.1" Version="1.0.1" />
<PackageVersion Include="Connectwise.SDK.v2025.1" Version="1.0.1" />
<PackageReference Include="Connectwise.SDK.v2025.1" />
paket add Connectwise.SDK.v2025.1 --version 1.0.1
#r "nuget: Connectwise.SDK.v2025.1, 1.0.1"
#:package Connectwise.SDK.v2025.1@1.0.1
#addin nuget:?package=Connectwise.SDK.v2025.1&version=1.0.1
#tool nuget:?package=Connectwise.SDK.v2025.1&version=1.0.1
ConnectWise.SDK.v2025.1
A .NET 8.0 SDK for interacting with the ConnectWise Manage API (v2025.1), generated using OpenAPI Generator with library=restsharp.
This package provides a typed API client, authentication via API keys, and is ready for use in modern .NET dependency injection setups.
π¦ Installation
Install via NuGet:
dotnet add package ConnectWise.SDK.v2025.1 --version 1.0.1
βοΈ Configuration
Add the following section to your appsettings.json:
"ConnectWise": {
"ApiUrl": "https://api-na.myconnectwise.net/v4_6_release/apis/3.0",
"ClientId": "your-client-id",
"CompanyName": "your-company",
"PublicKey": "your-public-key",
"PrivateKey": "your-private-key"
}
π Usage
βΉοΈ Note: You will need to implement a small wrapper around the SDK to handle authentication and inject the required configuration. A sample is shown below.
1. Create a Wrapper Class
public class ConnectWiseApi : IConnectWiseApi
{
private readonly ConnectWiseOptions _options;
private readonly Configuration _configuration;
public ConnectWiseApi(IOptions<ConnectWiseOptions> options)
{
_options = options?.Value ?? throw new ArgumentNullException(nameof(options));
_configuration = new Configuration
{
BasePath = _options.ApiUrl
};
_configuration.DefaultHeaders.Add("Authorization", BuildBasicAuthHeader(_options));
}
private static string BuildBasicAuthHeader(ConnectWiseOptions options)
{
string credentials = $"{options.CompanyName}+{options.PublicKey}:{options.PrivateKey}";
string base64Credentials = Convert.ToBase64String(Encoding.UTF8.GetBytes(credentials));
return $"Basic {base64Credentials}";
}
public string ClientId => _options.ClientId;
public ITicketsApi TicketsApi => new TicketsApi(_configuration);
}
2. Register with Dependency Injection
public static class ConnectWiseServiceCollectionExtensions
{
public static IServiceCollection AddConnectWiseApi(this IServiceCollection services, IConfiguration configuration)
{
services.Configure<ConnectWiseOptions>(configuration.GetSection("ConnectWise"));
services.AddTransient<IConnectWiseApi, ConnectWiseApi>();
return services;
}
}
3. Inject and Use
public class TicketService
{
private readonly IConnectWiseApi _connectWise;
public TicketService(IConnectWiseApi connectWise)
{
_connectWise = connectWise;
}
public IList<ServiceTicket> GetTickets()
{
return _connectWise.TicketsApi.GetServiceTickets(_connectWise.ClientId);
}
}
π§± Features
- β Strongly-typed SDK generated from OpenAPI spec
- π Basic Auth using CompanyName + PublicKey + PrivateKey
- π§° DI-ready with a custom wrapper
- π§ͺ Built on
RestSharpfor RESTful calls - ποΈ Compatible with .NET 8.0
π Project Structure
Api/β Grouped API classes (e.g.TicketsApi)Model/β Generated data modelsClient/Configuration.csβ BasePath and auth configuration
Note: You are expected to write your own
ConnectWiseApiintegration layer to inject auth headers.
π Authentication Format
This SDK uses Basic Authentication in the following format:
Authorization: Basic base64(company+publicKey:privateKey)
This must be set manually in your wrapper.
π ConnectWiseOptions
The ConnectWiseOptions class is a POCO that maps to your configuration section:
public class ConnectWiseOptions
{
public string ClientId { get; set; } = string.Empty;
public string ApiUrl { get; set; } = string.Empty;
public string CompanyName { get; set; } = string.Empty;
public string PublicKey { get; set; } = string.Empty;
public string PrivateKey { get; set; } = string.Empty;
}
Make sure this matches the structure of the "ConnectWise" section in your appsettings.json.
π License
This SDK is generated code and provided as-is.
Use is governed by the terms of the ConnectWise API Agreement.
π€ Contributing
Suggestions, fixes, or improvements welcome! Feel free to open an issue or submit a pull request.
π Example Usage in Blazor
Hereβs an example of how to consume the TicketsApi inside a Blazor component:
@code {
[Inject] public IConnectWiseApi ConnectWiseApi { get; set; } = default!;
private List<Ticket> ticket { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
ticket = await ConnectWiseApi.TicketsApi.GetServiceTicketsAsync(ConnectWiseApi.ClientId);
StateHasChanged();
}
}
}
π§© Example Usage in ASP.NET Core MVC
Hereβs how you might use the SDK in a typical MVC controller:
using Microsoft.AspNetCore.Mvc;
using NavWise.ConnectWise.Client;
using Connectwise.Model;
public class TicketsController : Controller
{
private readonly IConnectWiseApi _connectWiseApi;
public TicketsController(IConnectWiseApi connectWiseApi)
{
_connectWiseApi = connectWiseApi;
}
public async Task<IActionResult> Index()
{
List<Ticket> tickets = await _connectWiseApi.TicketsApi.GetServiceTicketsAsync(_connectWiseApi.ClientId);
return View(tickets);
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- JsonSubTypes (>= 2.0.1)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 8.1.0)
- RestSharp (>= 112.0.0)
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 |
|---|---|---|
| 1.0.1 | 2,413 | 5/31/2025 |
Minor update