Zammad.Client.SystemTextJson 4.1.0

dotnet add package Zammad.Client.SystemTextJson --version 4.1.0
                    
NuGet\Install-Package Zammad.Client.SystemTextJson -Version 4.1.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="Zammad.Client.SystemTextJson" Version="4.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zammad.Client.SystemTextJson" Version="4.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Zammad.Client.SystemTextJson" />
                    
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 Zammad.Client.SystemTextJson --version 4.1.0
                    
#r "nuget: Zammad.Client.SystemTextJson, 4.1.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.
#:package Zammad.Client.SystemTextJson@4.1.0
                    
#: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=Zammad.Client.SystemTextJson&version=4.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Zammad.Client.SystemTextJson&version=4.1.0
                    
Install as a Cake Tool

GitHub codecov NuGet NuGet

Zammad.Client.SystemTextJson

A hard fork of Zammad.Client with support for System.Text.Json instead of Newtonsoft.Json.

This library provides a .NET client for interacting with the Zammad helpdesk system API.

Compatibility

The integration tests on master run against Zammad 7.2.2 (ghcr.io/zammad/zammad:7.2.2). Each release is tested against one Zammad version only:

Library version Tested against Zammad
master (> 4.0.0) 7.2.2
4.0.0 7.2.0
3.0.0 7.0.1
2.0.0 – 2.4.0 6.5.2

Other versions usually work as long as the REST API hasn't changed, but they aren't tested.

Zammad changes that affect this client:

  • 7.2.1: ListTicketLinksAsync throws a ZammadException with 403 Forbidden for a ticket that doesn't exist or that the user can't read. Before, it returned an empty list.
  • 7.2.1: Overviews reject an order.direction or group_direction other than ASC or DESC with 422 Unprocessable Entity.
  • 7.2.1: Agents without admin permissions can no longer update users that have any admin.* permission.
  • 7.2.1: GetOnlineNotificationAsync throws a ZammadException with 403 Forbidden for a notification that doesn't exist. Before, it returned null. Notifications can also only be read or updated while the user can still access the related ticket.
  • 7.2.1: Articles created by customers drop preferences.

See Zammad's breaking changes for everything else. The 7.2.1 breaking changes (email_verify, getting_started, signshow and the WebSocket login) concern endpoints this client doesn't use.

Installation

dotnet add package Zammad.Client.SystemTextJson

Usage

Basic example:

var httpClient = new HttpClient();
var client = new ZammadClient(
    httpClient,
    Options.Create(new ZammadOptions
    {
        BaseUrl = new Uri("https://zammad.example.com/"),
        Token = "your_token_here",
    })
);

var user = await client.GetUserMeAsync();
Console.WriteLine($"Signed in as {user.FirstName} {user.LastName} ({user.Email})");

Dependency Injection

Install the extensions package:

dotnet add package Zammad.Client.SystemTextJson.Extensions

Configure the client:

builder.Services.AddZammadClient(options =>
{
    options.BaseUrl = new Uri("https://zammad.example.com/");
    options.Token = "your_token_here";
});

Alternatively, use a configuration section:

builder.Services.AddZammadClient(builder.Configuration.GetSection("Zammad"));

Then inject the client:

public class MyService(IZammadClient client)
{
    public async Task DoSomething()
     {
         var user = await client.GetUserMeAsync();
         Console.WriteLine($"Signed in as {user.FirstName} {user.LastName} ({user.Email})");
     }
}

HttpClient Customization

The AddZammadClient method returns an IHttpClientBuilder, allowing further customization of the underlying HttpClient. For example, to add a resilience handler:

dotnet add package Microsoft.Extensions.Http.Resilience
builder.Services.AddZammadClient(builder.Configuration.GetSection("Zammad"))
    .AddStandardResilienceHandler();

This configuration will automatically handle transient errors, making your application more robust.

Custom Fields

Custom attributes configured in the Zammad object manager end up in the ExtensionData dictionary of Ticket, User, Organization and Group. The extension methods in Zammad.Client.Resources.CustomFieldExtensions convert them from and to regular .NET types:

using Zammad.Client.Resources;

// Set custom fields when creating or updating a resource
var ticket = await client.CreateTicketAsync(
    new Ticket { Title = "Printer is on fire", GroupId = new GroupId(1), CustomerId = customerId }
        .WithCustomField("product", "Printer 3000")
        .WithCustomField("serial_number", 12345)
        .WithCustomField("affected_sites", new[] { "berlin", "hamburg" }),
    article
);

// Read them back
string? product = ticket.GetCustomField<string>("product");
int serialNumber = ticket.GetCustomField<int>("serial_number");
List<string>? sites = ticket.GetCustomField<List<string>>("affected_sites");

// Change or clear a single field
var update = new Ticket().WithCustomField("product", "Printer 4000");
update.ClearCustomField("serial_number");
await client.UpdateTicketAsync(ticket.Id, update);

If you have many custom fields, you can map all of them to a class with GetCustomFields<T>() and SetCustomFields(fields). Use [JsonPropertyName] to match the attribute names.

Contributing

Pull requests are welcome. Please use Conventional Commits to keep commit messages consistent.

Please consider adding tests for any new features or bug fixes.

Acknowledgements

License

Distributed under the Apache License 2.0. See LICENSE for more information.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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 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.  net11.0 is compatible. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Zammad.Client.SystemTextJson:

Package Downloads
Zammad.Client.SystemTextJson.Extensions

Extensions for Zammad.Client.SystemTextJson

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.1.0 864 11/10/2026
4.0.0 4,333 10/5/2026
3.0.0 4,996 5/8/2026
2.4.0 1,107 3/3/2026
2.3.0 543 11/14/2025
2.2.0 374 11/13/2025
2.1.0 333 10/17/2025
2.0.0 274 10/16/2025
2.0.0-alpha.42 204 10/15/2025
2.0.0-alpha.38 200 10/14/2025
2.0.0-alpha.37 204 10/13/2025
2.0.0-alpha.35 191 10/13/2025
2.0.0-alpha.29 147 10/10/2025
2.0.0-alpha.13 192 10/9/2025
2.0.0-alpha.10 191 10/9/2025