Altinn.ApiClients.Dialogporten.EndUser
1.118.10-alpha.1786357013
See the version list below for details.
dotnet add package Altinn.ApiClients.Dialogporten.EndUser --version 1.118.10-alpha.1786357013
NuGet\Install-Package Altinn.ApiClients.Dialogporten.EndUser -Version 1.118.10-alpha.1786357013
<PackageReference Include="Altinn.ApiClients.Dialogporten.EndUser" Version="1.118.10-alpha.1786357013" />
<PackageVersion Include="Altinn.ApiClients.Dialogporten.EndUser" Version="1.118.10-alpha.1786357013" />
<PackageReference Include="Altinn.ApiClients.Dialogporten.EndUser" />
paket add Altinn.ApiClients.Dialogporten.EndUser --version 1.118.10-alpha.1786357013
#r "nuget: Altinn.ApiClients.Dialogporten.EndUser, 1.118.10-alpha.1786357013"
#:package Altinn.ApiClients.Dialogporten.EndUser@1.118.10-alpha.1786357013
#addin nuget:?package=Altinn.ApiClients.Dialogporten.EndUser&version=1.118.10-alpha.1786357013&prerelease
#tool nuget:?package=Altinn.ApiClients.Dialogporten.EndUser&version=1.118.10-alpha.1786357013&prerelease
Altinn.ApiClients.Dialogporten.EndUser
.NET SDK for the Dialogporten EndUser API. Provides a typed HTTP client for reading dialogs and related resources on behalf of end users, backed by Maskinporten authentication and automatic EdDSA key caching for dialog token validation.
Sample projects are available at https://github.com/Altinn/dialogporten-samples.
Installation
dotnet add package Altinn.ApiClients.Dialogporten.EndUser
Targets net8.0, net9.0, and net10.0.
Setup
Register the client in your DI container using AddDialogportenClient. The BaseUri must point to the Dialogporten root, excluding /api/v....
| Environment | BaseUri |
|---|---|
| Production | https://platform.altinn.no/dialogporten |
| TT02 | https://platform.tt02.altinn.no/dialogporten |
Built-in Maskinporten authentication
Provide Maskinporten settings and the SDK handles token acquisition automatically. The required scope is digdir:dialogporten.
builder.Services.AddDialogportenClient(options =>
{
options.BaseUri = "https://platform.altinn.no/dialogporten";
options.Maskinporten = new MaskinportenSettings
{
Authority = "https://maskinporten.no/",
ClientId = "your-client-id",
Scope = "digdir:dialogporten",
// Supply either EncodedJwk or a certificate
EncodedJwk = "..."
};
});
Custom authentication
If you manage Maskinporten tokens yourself (e.g. via a shared client definition), use the overload that accepts an IHttpClientBuilder delegate:
builder.Services.AddDialogportenClient(
options => options.BaseUri = "https://platform.altinn.no/dialogporten",
httpClientBuilder => httpClientBuilder.AddMaskinportenHttpMessageHandler<MyClientDefinition>("my-key")
);
Using the client
Inject IEndUserApi and call methods on the V1 property:
public class MyService(IEndUserApi dialogporten)
{
public async Task<ICollection<DialogListItem>> GetMyDialogsAsync(CancellationToken ct)
{
var response = await dialogporten.V1.SearchDialogs(
new SearchDialogsQueryParams { Status = [DialogStatus.InProgress] },
cancellationToken: ct);
if (!response.IsSuccessStatusCode)
throw new Exception($"Failed: {response.StatusCode}");
return response.Content!.Items;
}
}
All methods return IApiResponse<T> (or IApiResponse for void responses) from Refit, giving you access to the status code, headers, and deserialized content.
Available operations
Dialogs
| Method | Description |
|---|---|
SearchDialogs(queryParams, acceptLanguage, ct) |
Paginated list of dialogs. Use continuationToken from the response to page through results. |
GetDialog(dialogId, acceptLanguage, ct) |
Single dialog aggregate. Accessing this endpoint marks the dialog content as seen. |
GetDialogLookup(instanceRef, acceptLanguage, ct) |
Resolve dialog metadata by an external instance reference. |
Search filter highlights (SearchDialogsQueryParams):
Org,ServiceResource,Party— filter by org, resource, or receiving partyStatus—New,InProgress,Waiting,Signing,Cancelled,CompletedSystemLabel—Default,Bin,ArchiveCreatedAfter/Before,UpdatedAfter/Before,DueAfter/BeforeIsContentSeen— filter by seen/unseen contentSearch/SearchLanguageCode— free-text fuzzy searchContinuationToken,Limit(1–1000, default 100)
Dates must include an explicit time zone, e.g. 2024-01-15T10:00:00Z.
Transmissions
| Method | Description |
|---|---|
SearchDialogTransmissions(dialogId, acceptLanguage, ct) |
All transmissions for a dialog. |
GetDialogTransmission(dialogId, transmissionId, acceptLanguage, ct) |
Single transmission. |
Activities
| Method | Description |
|---|---|
SearchDialogActivities(dialogId, acceptLanguage, ct) |
All activities for a dialog. |
GetDialogActivity(dialogId, activityId, acceptLanguage, ct) |
Single activity. |
Seen log
| Method | Description |
|---|---|
SearchDialogSeenLogs(dialogId, ct) |
All seen-log records for a dialog. |
GetDialogSeenLog(dialogId, seenLogId, ct) |
Single seen-log record. |
System labels
| Method | Description |
|---|---|
SetDialogSystemLabels(dialogId, request, ifMatch, ct) |
Set system label(s) on a single dialog. Supply EnduserContextRevision as ifMatch for optimistic concurrency. |
BulkSetDialogSystemLabels(dto, ct) |
Set system labels on multiple dialogs in one call. |
SearchDialogLabelAssignmentLogs(dialogId, ct) |
History of label assignment changes for a dialog. |
Parties and resources
| Method | Description |
|---|---|
GetParties(ct) |
Authorized parties available to the authenticated end user. |
SearchAuthorizedServiceResources(party, acceptLanguage, ct) |
Service resources the end user is authorized to access, optionally filtered by party. |
Dialog token validation
Dialogporten issues short-lived EdDSA-signed dialog tokens when an end user accesses a dialog. Your backend can validate these tokens using the injected IDialogTokenValidator:
public class MyController(IDialogTokenValidator validator)
{
[HttpGet("resource/{dialogId}")]
public IActionResult Get(Guid dialogId, [FromHeader] string dialogToken)
{
var result = validator.Validate(dialogToken, dialogId: dialogId, requiredActions: ["read"]);
if (!result.IsValid)
return Forbid();
// result.ClaimsPrincipal is non-null here
return Ok();
}
}
The validator caches public keys fetched from the Dialogporten .well-known endpoint (via a background hosted service). By default it throws on startup if keys cannot be fetched; set ThrowOnPublicKeyFetchInit = false in DialogportenSettings to make startup tolerant of transient failures.
DialogTokenValidationParameters lets you override defaults globally or per-call:
// Per-call override with extra clock skew
var result = validator.Validate(token, options: new DialogTokenValidationParameters
{
ClockSkew = TimeSpan.FromSeconds(30)
});
Settings reference
{
"Dialogporten": {
"BaseUri": "https://platform.altinn.no/dialogporten",
"ThrowOnPublicKeyFetchInit": true,
"Maskinporten": {
"Authority": "https://maskinporten.no/",
"ClientId": "your-client-id",
"Scope": "digdir:dialogporten",
"EncodedJwk": "..."
}
}
}
Bind and register:
var settings = builder.Configuration
.GetSection("Dialogporten")
.Get<DialogportenSettings>()!;
builder.Services.AddDialogportenClient(settings);
| Product | Versions 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 is compatible. 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 is compatible. 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. |
-
net10.0
- Altinn.ApiClients.Maskinporten (>= 10.1.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- NSec.Cryptography (>= 25.4.0)
- Refit (>= 10.2.0)
- Refit.HttpClientFactory (>= 10.2.0)
-
net8.0
- Altinn.ApiClients.Maskinporten (>= 10.1.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- NSec.Cryptography (>= 25.4.0)
- Refit (>= 10.2.0)
- Refit.HttpClientFactory (>= 10.2.0)
-
net9.0
- Altinn.ApiClients.Maskinporten (>= 10.1.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- NSec.Cryptography (>= 25.4.0)
- Refit (>= 10.2.0)
- Refit.HttpClientFactory (>= 10.2.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.120.1-alpha.1788463247 | 24 | 9/3/2026 |
| 1.120.1-alpha.1788421084 | 19 | 9/3/2026 |
| 1.120.0-alpha.1788168647 | 23 | 8/31/2026 |
| 1.120.0-alpha.1787836907 | 28 | 8/27/2026 |
| 1.119.1-alpha.1787818050 | 26 | 8/27/2026 |
| 1.119.0-alpha.1787147189 | 32 | 8/19/2026 |
| 1.119.0-alpha.1787133628 | 34 | 8/19/2026 |
| 1.118.10-alpha.1786357013 | 37 | 8/10/2026 |
| 1.118.10-alpha.1786346925 | 33 | 8/10/2026 |
| 1.118.7-alpha.1784896114 | 60 | 7/24/2026 |
| 1.118.5-alpha.1783684334 | 44 | 7/10/2026 |
| 1.118.3-alpha.1782730692 | 43 | 6/29/2026 |
| 1.118.2-alpha.1782470229 | 46 | 6/26/2026 |
| 1.118.2-alpha.1782457940 | 45 | 6/26/2026 |
| 1.118.1-alpha.1782383615 | 49 | 6/25/2026 |
| 1.118.1-alpha.1782297319 | 48 | 6/24/2026 |
| 1.118.1-alpha.1782217135 | 45 | 6/23/2026 |
| 1.117.3-alpha.1781864238 | 47 | 6/19/2026 |
| 1.117.3-alpha.1781828297 | 49 | 6/19/2026 |
| 1.117.3-alpha.1781819871 | 43 | 6/18/2026 |