ConnectWise.Http 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ConnectWise.Http --version 1.0.0
NuGet\Install-Package ConnectWise.Http -Version 1.0.0
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.Http" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ConnectWise.Http --version 1.0.0
#r "nuget: ConnectWise.Http, 1.0.0"
#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.
// Install ConnectWise.Http as a Cake Addin
#addin nuget:?package=ConnectWise.Http&version=1.0.0

// Install ConnectWise.Http as a Cake Tool
#tool nuget:?package=ConnectWise.Http&version=1.0.0

ConnectWise.Http

A .Net HttpClient wrapper for interacting with the ConnectWise Manage REST API.

Usage

Client Setup

using ConnectWise.Http;

// Create Settings
var settings = new CWApiSettings(
  "https://cw.siteurl.com",
  "companyName",
  new MemberAuthSettings("publicKey", "privateKey")
  );

// Create HTTP Client
var client = new CWHttpClient(settings);

GET Request

using ConnectWise.Http.Modules.Service;

// Build & Send Request
int ticketId = 121;
var request = ServiceModule.Tickets.GetRequest(ticketId);
var response = await client.SendAsync(request);

POST/PUT Request

You serialize the body content before building the request.

// Build & Send Request
string serializedContent = JsonConvert.SerializeObject(...);
var request = ServiceModule.Tickets.CreateRequest(serializedContent);
var response = await client.SendAsync(request);

PATCH Request

ConnectWise.Http provides a ConnectWise Patch Operation object as per their REST developer documentation.

// List Patch Operations
var operations = new List<CWPatch>();
operations.Add(new CWPatch {
  Op = CWPatchOperation.Replace,
  Path = "status/name",
  Value = "Closed"
  });
  
// Build & Send Request
int ticketId = 121;
var request = ServiceModule.Tickets.UpdateRequest(ticketId, operations);
var response = await client.SendAsync(request);
Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 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.1.1 18,940 8/22/2019
1.1.0 1,459 7/14/2019
1.0.9 2,532 10/1/2018
1.0.8 1,874 5/24/2018
1.0.7 1,788 5/24/2018
1.0.6 1,779 5/22/2018
1.0.5 1,856 4/30/2018
1.0.4 1,935 4/27/2018
1.0.3 1,739 4/26/2018
1.0.2 2,103 12/10/2017
1.0.0.1 1,783 11/22/2017
1.0.0 1,868 11/22/2017

First Release: Use CWHttpClient to simplify requests made to the Connectwise Manage REST API.