Skip to content

digiseg-labs/api-client-dotnet

Repository files navigation

Digiseg API client for .NET

This package provides a SDK for interacting with the Digiseg API.

Documentation for the API can be found on https://developer.digiseg.net/

Using the client package

You can either clone this repository, which will allow you to build your own client, or you can depend on the NuGet package, like this:

dotnet add package Digiseg.Api.Client --version 1.0.2

You can code against the API, like this:

using Digiseg.Api.Client;
using Digiseg.Api.Client.Models;

var client = Factory.ApiKeyClient(apiKey);
var audiencesResponse = await client.Audiences["80.62.14.129"].GetAsync();
audiencesResponse?.Audiences?.ForEach(x =>
{
    Console.WriteLine("Audience code: " + x.Code);
});

NuGet release process

Based on https://learn.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli

Make sure you have your NuGet API key.

Set it to the env. variable NUGET_APIKEY.

Then update the <Version> in file DigisegApiClient/DigisegApiClient.csproj.

Set the version to the env. variable NUGET_VERSION.

Then run:

dotnet restore
dotnet tool restore
dotnet build --configuration Release --no-restore
dotnet pack
dotnet nuget push DigisegApiClient/bin/Release/Digiseg.Api.Client.${NUGET_VERSION}.nupkg --api-key $NUGET_APIKEY --source https://api.nuget.org/v3/index.json

Languages