NOTE: This repo has been superseded by apialerts-csharp
The ApiAlerts NuGet package simplifies the process of setting up and managing alerts within your API projects. It provides functionalities to activate the package with an API key and offers methods for publishing alerts asynchronously and synchronously.
To install the ApiAlerts package, simply use NuGet Package Manager or the Package Manager Console:
PM> Install-Package ApiAlertsApiAlerts.Activate(yourApiKey);To publish alerts, you'll utilize the IAlertService interface.
You can publish an alert synchronously using the PublishAlert method, which takes an ApiAlert object and an optional API key.
var alert = new ApiAlert { /* alert properties */ };
IAlertService alertService = new AlertService(); // Instantiate or inject IAlertService
alertService.PublishAlert(alert, optionalApiKey);Alternatively, you can publish an alert asynchronously using the PublishAlertAsync method, which also takes an ApiAlert object and an optional API key.
var alert = new ApiAlert { /* alert properties */ };
IAlertService alertService = new AlertService(); // Instantiate or inject IAlertService
await alertService.PublishAlertAsync(alert, optionalApiKey);