Some projects to access the Exact Online REST API using C#.
A Kiota generated C# client for Exact Online to access the REST API.
var builder = Host.CreateDefaultBuilder(args)
.ConfigureServices((context, services) =>
{
services
.AddLogging()
.AddExactOnlineTokenStorageAzureBlobs(context.Configuration)
.AddExactOnlineKiotaAuthentication(context.Configuration);
});
var host = builder.Build();
using var scope = host.Services.CreateScope();
var me = await client.Api.V1.Current.Me.GetAsync().AsItem();
Console.WriteLine($"{me.CurrentDivision} {me.Email}");Implementation of the OAuth authentication for Exact Online.
It uses the ExactOnline.Api.Client.Authentication.Abstractions interfaces package to store the Refresh Token in a storage.
Contains an implementation of the IAuthenticationProvider interface for Kiota, which is used to authenticate requests to the Exact Online API.
An interface IExactTokenStorageService which defines how to store and retrieve the Refresh and Access Tokens.
This interface is implemented by several packages, like:
In case the Exact Online REST interface is changed, you can regenerate the client using the following commands:
This dotnet tool generates a OpenApi.json file. Idea based on exact-online-meta-data-tool.
dotnet tool install --global ExactOnline.OpenApiGeneratorExactOnline.OpenApiGenerator --destination "../../../../../resources/exactonline-openapi.json"./kiota-generate.ps1