Installation
- NuGet CLI
- Package Manager Console
Requirements
- .NET 7.0 or later
- Valid WSAPI API key and instance ID
Quick start
Dependency injection (recommended)
Register the WSAPI client in your DI container for ASP.NET Core applications:IWSApiClient where needed:
WSApi.Client.ApiClient (e.g., GroupsClient, ChatsClient, ContactsClient) or through the unified IWSApiClient interface.
Error handling
The SDK provides two method variants for every operation:- Exception-based
- Try-based (non-throwing)
Standard methods throw exceptions when API calls fail and return the result directly on success:
Receiving events via SSE
Create aBackgroundService to handle SSE events:
Program.cs: