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
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="N2C.VismaNET.WebhookNotificationFeedbackHandler" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add N2C.VismaNET.WebhookNotificationFeedbackHandler --version 1.0.1
#r "nuget: N2C.VismaNET.WebhookNotificationFeedbackHandler, 1.0.1"
#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.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 99 2/2/2024