ArByte.Kvk.Api.Client 1.0.0

dotnet add package ArByte.Kvk.Api.Client --version 1.0.0
                    
NuGet\Install-Package ArByte.Kvk.Api.Client -Version 1.0.0
                    
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="ArByte.Kvk.Api.Client" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ArByte.Kvk.Api.Client" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ArByte.Kvk.Api.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ArByte.Kvk.Api.Client --version 1.0.0
                    
#r "nuget: ArByte.Kvk.Api.Client, 1.0.0"
                    
#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.
#:package ArByte.Kvk.Api.Client@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ArByte.Kvk.Api.Client&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ArByte.Kvk.Api.Client&version=1.0.0
                    
Install as a Cake Tool

Kvk.Api.Client Nuget .NET Integration Tests

Kvk.Api.Client

Een eenvoudige, sterk getypeerde en configureerbare .NET API-client voor de Kvk API bedrijfsregistratie-API. Ondersteunt zoeken, basisprofiel, vestigingsprofiel, naamgeving en mutatieservice met ingebouwde foutverwerking en eenvoudige DI-integratie.


Features

  • Automatische foutverwerking met expliciete uitzonderingen voor API-fouten
  • Ondersteunt annuleringstokens voor asynchrone aanroepen
  • Eenvoudige integratie met IHttpClientFactory en Dependency Injection
  • Inclusief integratietests om API-interacties te verifi�ren

Installatie

Install de NuGet package met:

dotnet add package ArByte.Kvk.Api.Client

Getting Started

Registratie van de cli�nt

Configureer uw services in Startup.cs of waar DI configureert wordt:

// Registreer alle Kvk API clients:
services.AddKvkApiClients(Configuration.GetSection("Kvk"));

// Of registreer afzonderlijk:
services.AddKvkApiV1Client(Configuration.GetSection("Kvk"));
services.AddKvkApiV2Client(Configuration.GetSection("Kvk"));

Uw configuratie moet minimaal het volgende bevatten:

{
  "Kvk": {
    "ApiKey": "your_api_key_here"
  }
}

Gebruiksvoorbeeld

Injecteer IKvkApiV1Client of IKvkApiV2Client in een service of controller:

public class KvkService
{
    private readonly IKvkApiV2Client _kvkApiV2Client;

    public KvkService(IKvkApiV2Client kvkApiV2Client)
    {
        _kvkApiV2Client = kvkApiV2Client;
    }

    public async Task PrintCompanyNameAsync(string kvkNummer, CancellationToken cancellationToken = default)
    {
        var request = new ZoekRequest()
        {
            KvkNummer = kvkNummer,
        };

        var response = await _kvkApiV2Client.ZoekenAsync(request, cancellationToken);

        foreach (var resulaat in response.Resultaten)
        {
            Console.WriteLine($"{resulaat.KvkNummer}: {resulaat.Naam}");
        }
    }
}

Foutafhandeling

API-fouten gooien expliciete uitzonderingen af die afgeleid zijn van KvkApiException, zoals:

  • KvkApiBadRequestException (400)
  • KvkApiNotFoundException (404)
  • KvkApiServerException (500)
  • En andere volgens de Kvk IPD codes.

Gebruik try-catch-blokken om deze op een nette manier af te handelen.


Testen

Inclusief integratietests met xUnit om het gedrag van de live API te verifi�ren. Configureer je KVK_API_KEY omgevingsvariabele voordat je de tests uitvoert.


Bijdragen

Bijdragen zijn welkom! Open issues of pull requests.


Licentie

Dit project is gelicentieerd onder de MIT-licentie � zie het LICENSE bestand voor details.


Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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.0 201 9/24/2025