N2C.VismaNET.WebhookNotificationFeedbackHandler
1.0.1
dotnet add package N2C.VismaNET.WebhookNotificationFeedbackHandler --version 1.0.1
NuGet\Install-Package N2C.VismaNET.WebhookNotificationFeedbackHandler -Version 1.0.1
<PackageReference Include="N2C.VismaNET.WebhookNotificationFeedbackHandler" Version="1.0.1" />
paket add N2C.VismaNET.WebhookNotificationFeedbackHandler --version 1.0.1
#r "nuget: N2C.VismaNET.WebhookNotificationFeedbackHandler, 1.0.1"
// Install N2C.VismaNET.WebhookNotificationFeedbackHandler as a Cake Addin #addin nuget:?package=N2C.VismaNET.WebhookNotificationFeedbackHandler&version=1.0.1 // Install N2C.VismaNET.WebhookNotificationFeedbackHandler as a Cake Tool #tool nuget:?package=N2C.VismaNET.WebhookNotificationFeedbackHandler&version=1.0.1
Visma.NET Webhook Notification Feedback Handler
When receiving a notification it is best practice to respond to this by providing a feedback to Visma.net that you’ve received and handled the notification. This feedback will be visible in the Visma.net user interface and provide the user with important feedback that the notification is handled.
Getting Started
You need to have a valid token to be able to use the API. You can get a token by using the Visma.net API Authentication. You can use the N2C.VismaNET.Token package.
You will also need the tenantId for the Visma.net API. This is the same tenantId that you use for the Visma.net API Authentication.
Prerequisites
- N2C.VismaNET.Token
- N2C.VismaNET.DTOs
Usage
- PostFeedbackAsync sends a feedback to the Visma.net API.
// Create a new instance of the FeedbackHandler
var handler = new FeedbackHandler(bearerToken, tenantId);
// Create a new instance of the Feedback from the N2C.VismaNET.DTOs namespace
var feedback = new DTOs.WebhookNotificationFeedback
{
NotificationId = "notificationId, this is the id of the notification that was received.",
Source = "The source of the notification, for example the endpoint that received the notification.",
Description = "A description of the feedback.",
IsSuccess = true/false
};
// Send the feedback to the Visma.net API
var result = await handler.PostFeedbackAsync(feedback);
// Check the result
switch (result)
{
case HttpStatusCode.Created:
// The feedback was successfully sent to the Visma.net API.
break;
case HttpStatusCode.Accepted:
// The feedback was successfully sent to the Visma.net API and is being processed.
break;
default:
throw new Exception($"Failed to send feedback to Visma.net API. Status code: {result}");
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- N2C.VismaNET.DTOs (>= 1.0.8)
- N2C.VismaNET.HttpBase (>= 1.0.4)
- N2C.VismaNET.Interfaces (>= 1.0.0)
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.1 | 137 | 2/2/2024 |