WuzApiClient.Results
1.0.0-preview.6
dotnet add package WuzApiClient.Results --version 1.0.0-preview.6
NuGet\Install-Package WuzApiClient.Results -Version 1.0.0-preview.6
<PackageReference Include="WuzApiClient.Results" Version="1.0.0-preview.6" />
<PackageVersion Include="WuzApiClient.Results" Version="1.0.0-preview.6" />
<PackageReference Include="WuzApiClient.Results" />
paket add WuzApiClient.Results --version 1.0.0-preview.6
#r "nuget: WuzApiClient.Results, 1.0.0-preview.6"
#:package WuzApiClient.Results@1.0.0-preview.6
#addin nuget:?package=WuzApiClient.Results&version=1.0.0-preview.6&prerelease
#tool nuget:?package=WuzApiClient.Results&version=1.0.0-preview.6&prerelease
WuzAPI Client
A .NET client library for WhatsApp operations via the WuzAPI gateway, featuring strongly-typed event handling and railway-oriented error handling.
1. What is this?
WuzAPI Client is a .NET Standard 2.0 library that provides a type-safe interface to the asternic/wuzapi WhatsApp gateway. It enables .NET applications to send WhatsApp messages, manage contacts, groups, and process incoming WhatsApp events through RabbitMQ with the Result pattern for error handling.
The library uses Microsoft.Extensions.* for dependency injection, configuration, and hosted services.
2. Quick Links
- Getting Started: docs/intro/getting-started.md
- Event Handling Guide: docs/usage/event-handling.md
- Configuration Reference: docs/usage/configuration.md
- API Reference: docs/api/http-client-reference.md
- Integration Testing: scripts/README.md
- Event Dashboard: tools/WuzApiClient.EventDashboard/README.md - Real-time event visualization tool
- Documentation Map: docs_map.md
3. Getting Started (Quick Start)
Prerequisites
- .NET Standard 2.0 compatible runtime (.NET Core 2.0+, .NET Framework 4.6.1+, .NET 5+)
- Running asternic/wuzapi gateway instance
- RabbitMQ instance (for event handling)
Installation
dotnet add package WuzApiClient
dotnet add package WuzApiClient.RabbitMq # For event handling
Basic Usage
using WuzApiClient.Core.Interfaces;
using WuzApiClient.Configuration;
using WuzApiClient.Models.Common;
// Register factories in DI container (server settings only)
services.AddWuzApi(options =>
{
options.BaseUrl = "http://your-wuzapi-gateway:8080/";
});
// Use factories to create clients with dynamic tokens
public sealed class WhatsAppService
{
private readonly IWaClientFactory clientFactory;
public WhatsAppService(IWaClientFactory clientFactory)
{
this.clientFactory = clientFactory;
}
public async Task SendMessageAsync(string userToken)
{
// Create client with user-specific token
var client = this.clientFactory.CreateClient(userToken);
var result = await client.SendTextMessageAsync(
Phone.Create("5511999999999"),
"Hello from WuzAPI!"
);
if (result.IsSuccess)
{
Console.WriteLine($"Message sent: {result.Value.MessageId}");
}
else
{
Console.WriteLine($"Error: {result.Error.Message}");
}
}
}
See Getting Started for a full guide.
4. Key Features
- Factory-First Multi-Account Design – Create clients dynamically via
IWaClientFactorywith per-request tokens - Clean REST API Client – Send messages, manage contacts, groups, and channels via
IWaClient - Strongly-Typed Event Handling – Process 44 WhatsApp event types with generic
IEventHandler<TEvent> - Railway-Oriented Error Handling – Uses
WuzResult<T>monad instead of exceptions for predictable error flows - Microsoft.Extensions Integration – Built on
Microsoft.Extensions.*(DI, Options, HostedService, Logging) - HttpClientFactory Integration – Proper handler pooling with extensible pipeline (Polly, logging, etc.)
- Event Filtering Pipeline – Filter events before processing with
IEventFilter - RabbitMQ Event Consumer – Background service consumes WhatsApp events from message queue
- .NET Standard 2.0 – Broad compatibility across .NET platforms
5. High-Level Architecture
The library consists of two main components:
- WuzApiClient – HTTP client wrapping the asternic/wuzapi REST API for outbound WhatsApp operations (sending messages, managing contacts, etc.)
- WuzApiClient.RabbitMq – Event consumer that processes incoming WhatsApp events from a RabbitMQ queue
The architecture follows clean separation of concerns:
- Factory Pattern –
IWaClientFactoryandIWuzApiAdminClientFactorycreate clients with dynamic tokens - Interfaces define public contracts (
IWaClient,IWuzApiAdminClient,IEventHandler<T>) - Implementation handles HTTP communication and RabbitMQ consumption
- Result Pattern (
WuzResult<T>) eliminates exception-based error handling - Dependency Injection via
Microsoft.Extensions.DependencyInjection
This library sits between your .NET application and the asternic/wuzapi gateway, which in turn communicates with WhatsApp servers.
Your .NET App → WuzApiClient → asternic/wuzapi Gateway → WhatsApp
↑
RabbitMQ (events)
For more details, see the Overview.
6. Documentation
Full documentation is available in the docs/ folder. See docs_map.md for the full index.
| Product | Versions 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 was computed. 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. |
| .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. |
-
.NETStandard 2.0
- System.Memory (>= 4.6.3)
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.0-preview.6 | 330 | 12/4/2025 | |
| 1.0.0-preview.5 | 194 | 12/3/2025 | |
| 1.0.0-preview.4 | 665 | 12/2/2025 | |
| 1.0.0-preview.3 | 565 | 12/1/2025 | |
| 1.0.0-preview.2 | 424 | 11/30/2025 | |
| 1.0.0-preview.1 | 124 | 11/29/2025 |