Arbeidstilsynet.Common.Altinn 3.2.4

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Arbeidstilsynet.Common.Altinn --version 3.2.4
                    
NuGet\Install-Package Arbeidstilsynet.Common.Altinn -Version 3.2.4
                    
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="Arbeidstilsynet.Common.Altinn" Version="3.2.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Arbeidstilsynet.Common.Altinn" Version="3.2.4" />
                    
Directory.Packages.props
<PackageReference Include="Arbeidstilsynet.Common.Altinn" />
                    
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 Arbeidstilsynet.Common.Altinn --version 3.2.4
                    
#r "nuget: Arbeidstilsynet.Common.Altinn, 3.2.4"
                    
#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 Arbeidstilsynet.Common.Altinn@3.2.4
                    
#: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=Arbeidstilsynet.Common.Altinn&version=3.2.4
                    
Install as a Cake Addin
#tool nuget:?package=Arbeidstilsynet.Common.Altinn&version=3.2.4
                    
Install as a Cake Tool

Arbeidstilsynet.Common.Altinn

A collection of common patterns and extensions for cross-cutting concerns for applications which need to interact with Altinns APIs.

📖 Installation

To install the package, use the following command in your terminal:

dotnet add package Arbeidstilsynet.Common.Altinn

🚀 Features

  • Extension Methods for common Altinn operations
  • Altinn Adapter Provides a high-level abstraction for Arbeidstilsynet’s integration needs, streamlining communication with Altinn instances.
  • Altinn API Clients Robust REST API clients for direct and flexible interaction with Altinn’s services, supporting both general and advanced use cases.

🧑‍💻 Usage

Dependency Injection Setup

Consuming Altinn Instances
var builder = WebApplication.CreateBuilder(args);
var services = builder.Services;
var appSettings = builder.Configuration.GetRequired<MyAppSettings>();

// Adds IAltinnAdapter, which abstracts communication with Altinn instances.
services.AddAltinnAdapter(builder.Environment, appSettings.MaskinportenConfiguration);

// Adds Altinn API clients for consuming Altinn services, at a lower level of abstraction than IAltinnAdapter
services.AddAltinnApiClients(builder.Environment, appSettings.MaskinportenConfiguration);

🤝 Contributing

This library follows standard .NET conventions and includes comprehensive unit tests. When contributing:

  1. Add unit tests for new functionality
  2. Follow existing code patterns
  3. Update documentation for new features
  4. Ensure all tests pass

📄 License

This project is licensed under the terms specified by Arbeidstilsynet.

Product Compatible and additional computed target framework versions.
.NET 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. 
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
4.2.1 117 10/15/2026
4.2.0 194 10/14/2026
4.1.0 106 10/14/2026
4.0.7 344 10/9/2026
4.0.6 492 10/5/2026
4.0.5 182 10/5/2026
4.0.4 310 10/1/2026
4.0.3 227 10/1/2026
4.0.3-alpha2 94 10/1/2026
4.0.3-alpha1 95 10/1/2026
4.0.2 129 10/1/2026
4.0.1 121 10/1/2026
4.0.1-alpha1 102 10/1/2026
4.0.0 133 9/30/2026
4.0.0-alpha9 154 9/24/2026
4.0.0-alpha7 111 9/4/2026
4.0.0-alpha10 323 9/29/2026
3.4.0 1,882 9/14/2026
3.3.0 125 9/14/2026
3.2.4 2,832 7/1/2026
Loading failed

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added <!-- for new features. -->

### Changed <!--  for changes in existing functionality. -->

### Deprecated <!--  for soon-to-be removed features. -->

### Removed <!-- for now removed features. -->

### Fixed <!-- for any bug fixes. -->

### Security <!-- in case of vulnerabilities. -->

## 3.2.4

### Changed

- changed(deps): Applied minor and patch updates to dependencies

## 3.2.3

### Fixed

- fix(altinn): `GetNonCompletedInstances` now handles per-instance summary failures by logging a warning and continuing with remaining instances.
- fix(altinn): replaced generic `InvalidOperationException` throws in instance summary flow with custom exceptions containing instance-specific context.

## 3.2.2

### Fixed

- fix(altinn): `GetSpecification` no longer throws `NullReferenceException` when `DataValues` is `null` on an `AltinnInstance`

## 3.2.1

### Changed

- chore(altinn): Updated default URL mapping for development environment to match new altinn studiocli setup.

## 3.2.0

### Added

- feat(altinn): Added `Validated` property to `AltinnSubscription` response model, indicating whether the subscription has been validated by Altinn.

## 3.1.1

### Fixed

- fix(altinn): added necessary null checks when converting an altinn instance to metadata

## 3.1.0

### Added

- feat(altinn): Enhace `AltinnMetaData` to include dialogId and all DataValues which come from an altinn instance.
- feat(altinn): Added ``AltinnDialogportenClient`` to support communication with dialogporten. Can be injected via ``IAltinnDialogportenClient`` and requires a maskinporten integration with the following altinn scope to work: `altinn:serviceowner`. Right now the client only supports one method to retrieve a dialogId based on an instanceId.
- fix(extensions): make all methods in `HostEnvironmentExtensions` publicly available

## 3.0.0

### Removed

- **BREAKING**: Removed dependency on `Arbeidstilsynet.Common.AspNetCore.Extensions`

### Changed

- Added `FrameworkReference` to `Microsoft.AspNetCore.App` for ASP.NET Core types

## 2.6.1

### Changed

- changed(deps): Applied minor and patch updates to dependencies

## 2.6.0

### Added

- feat(altinn): Added ``AltinnCorrespondenceClient`` to support posting correspondences, with and without attachments. Can be injected via ``IAltinnCorrespondenceClient`` and requires a maskinporten integration with the following altinn scope to work: `altinn:correspondence.write`. It is also possible to retrieve a correspondence by ID.
- feat(altinn): Added ``AltinnMeldingerAdapter`` to make usage of the ``IAltinnCorrespondenceClient`` easier. Can be injected via ``IAltinnMeldingerAdapter``.

### Changed

- feat(maskinporten): Updated MaskinportenConfiguration to also support jwt token generation which includes a key identifier (`kid`) instead of only supporting identification by a certificate chain.

## 2.5.0

### Changed

- changed(deps): Applied minor and patch updates to dependencies

## 2.4.2

### Fixed

- Fixed a bug where a partial altinn configuration would overwrite defaults.

## 2.4.1

### Changed

- chore: moved package to nuget.org

## 2.4.0

### Added

- feat(altinn): Differentiate between structured data and the main content of the instance.
 - Implements the StructuredData configuration from AltinnApp 2.4.0.
 - Adds DataType and Id from the Altinn DataElement to the FileMetadata of the AltinnDocument.

## 2.3.0

### Added

- feat(altinn): Enhanced ``AltinnEventsClient`` to support retrieving details for a subscriptions. Also updated ``IAltinnAdapter`` to implement a convenience method for getting these details.

## 2.2.0

### Changed

- changed(deps): Applied minor and patch updates to dependencies

## 2.1.0

### Added

- feat(altinn): Enhanced ``AltinnEventsClient`` to support Unsubscribing. Also updated ``IAltinnAdapter`` to implement a convenience method for unsubscribing.

## 2.0.2

### Added

- feat(altinn): Added function to return only metadata for non completed instances (in order to not download attachments)

## 2.0.1

### Changed

- changed(deps): Updated internal package referances (remove prerelease version)

## 2.0.0

### Changed

- changed(deps): Major dotnet updated (v10)

## 1.4.0

### Changed

- changed: using "structured-data" as default dataType for MainDocument.

## 1.3.2

### Added

- chore: added extension methods to create a Dictionary based on `AltinnMetadata`.

## 1.3.1

### Fixed

- fix: add nullable declarations to `AltinnCloudEvent` dto to enable usage in a dotnet Controller.

## 1.3.0

### Changed

- changed: split up package to only contain logic to communicate with Altinns API. All logic with is only relevant for altinn apps was moved to the new AltinnApp package.

## 1.2.0

### Changed

- fix(deps): use correct version range to only support Microsoft version 8.* packages

## 1.1.0

### Fixed

- fix: move complete action to new "Apps Client" since all mutable instance actions must go through Apps Api instead of Storage Api

## 1.0.0

### Added

- feat: add altinn token provider and clients to handle token exchange

## 0.0.4

### Changed

- chore: enhance altinn metadata with process started / ended

## 0.0.3

### Changed

- chore(renovate): all non major update

## 0.0.2

### Changed

- chore(altinn-adapter): update FileMetadata model to return an enum of FileScanResults instead of a string

## 0.0.1

### Added

- **API Clients** to be used to consume public Altinn APIs
 - `Storage Api Client` for the storage API (Instance Data)
 - `Event Api Client` for the event API (Subscriptions)
- **Extension Methods** for common Altinn operations
 - `InstanceExtensions` - Extract GUID, app name, and party ID from instances
 - `DataClientExtensions` - Simplified form data retrieval and element deletion
 - `AssemblyExtensions` - Load and deserialize embedded JSON resources
- **Abstract Data Processors** for handling form data changes
 - `BaseDataProcessor<T>` - Base class for type-specific data processing
 - `MemberProcessor<T, TMember>` - Process changes to specific object members
 - `ListProcessor<T, TItem>` - Handle list/collection changes with item-level processing
- **Country Code Lookup Service** (`ILandskodeLookup`)
 - Country anmes and dial codes for 238 countries
- **Altinn Options Provider** for country dropdowns
 - `LandOptions` for Altinn dropdowns etc.