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
                    
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="Connectwise.SDK.v2025.1" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Connectwise.SDK.v2025.1" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Connectwise.SDK.v2025.1" />
                    
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 Connectwise.SDK.v2025.1 --version 1.0.1
                    
#r "nuget: Connectwise.SDK.v2025.1, 1.0.1"
                    
#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 Connectwise.SDK.v2025.1@1.0.1
                    
#: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=Connectwise.SDK.v2025.1&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Connectwise.SDK.v2025.1&version=1.0.1
                    
Install as a Cake Tool

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 RestSharp for RESTful calls
  • πŸ—οΈ Compatible with .NET 8.0

πŸ“ Project Structure

  • Api/ – Grouped API classes (e.g. TicketsApi)
  • Model/ – Generated data models
  • Client/Configuration.cs – BasePath and auth configuration

Note: You are expected to write your own ConnectWiseApi integration 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 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. 
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
1.0.1 2,413 5/31/2025

Minor update