:
Last modified: Feb 12, 2024

api

App metadata

Application The Application model is the main model for metadata for the application. Name Description id A gobally unique id for the application. The value has two parts separated by a ‘/’ character. The first part is the short name of the application owner and the second part is the name of the app. versionId The current version of the application. (Currently not in use.) org The short name of the application owner. »

App metadata

Overview The endpoints documented here are all for accessing metadata on the app itself and the data types that are allowed in an instance of the app. Additional endpoints provides access to text resources. Get app metadata Endpoint for downloading a copy of the application metadata document. GET {basePath}/api/v1/applicationmetadata Get Application texts Get text resources for the application for a specific language code. If the requested language isn’t available, norsk bokmål (nb) will be returned as default. »

Instance

Instance The Instance model is the main model of an instance. An instance can be regarded as an envelope or folder where data is collected and exchanged between the application user and owner. The instance document is a way for Altinn and external parties to track the state of one specific data exchange. Properties Name Description id A gobally unique id for the instance. The value has two parts separated by a ‘/’ character. »

Instances

Overview An instance can be regarded as an envelope or folder where data is collected and exchanged between the application user and owner. The instance document is a way for Altinn and external parties to track the state of one specific data exchange. How long an instance lives and how many interactions there are between the application owner and user will vary from one app to another. Advanced apps will have their own documentation. »

DataElement

DataElement The data element model is the main model for metadata related to a specific data element. A data element can be any data associated with an instance. The two most common type of data is the actual form data and attachments. Properties Name Description id A globally unique id for the data element. instanceGuid The globally unique id for the instance the data element is associated with. dataType The name of the data type describing the requirements of the data element. »

Authentication

Authentication for application owners Application owners should be authenticated with Maskinporten. API provisioning in Maskinporten API-provider To provide an API in maskinporten Altinn has to do two operations. As API-provider Altinn registers a scope in Maskinporten POST /scopes { "prefix": "altinn", "subscope": "instances/metadata.read", "description": "Clients can access metadata for all instances for all apps of the organisation" } As API-provider Altinn has to give access to its scope for a given organisation PUT /scopes/access/889640782? »

Data elements

Overview A data element consist of two parts: its metadata document and the actual data blob. This API work primarily with the blob while keeping the metadata document updated. basePath {org}/{appname}/instances/{instanceOwnerPartyId}/{instanceGuid}/data Get data Endpoint for downloading the data blob. GET basePath/{dataGuid} Accept: application/{xml/json} The response will depend on the type of blob. There are currently 2 primary types: form data based on a model and attachments. An Accept header in a request will be considered only when the requested data element is connected to a data model. »

Instances

Overview An instance works as a form of envelope or folder where data can be collected and exchanged between the user and owner of the application. The instance document is a way for Altinn and external parties to track the state of one specific data exchange. How long an instance can live and how many interactions there can be between the application owner and user will vary from one app to another. »

k6

k6 is a developer-centric, free and open-source load testing tool built for making performance testing a productive and enjoyable experience. read more about K6 here Set up k6 tests Clone the k6 tests from GitHub Repo Install docker and make sure the drive having the k6 tests is shared. Open cmd and download the latest k6 docker image docker pull loadimpact/k6 How to write k6 tests Find the area/collection where the new test has to be added. »

Postman

Postman To test API endpoints the tool postman enables easy configuration and setup of various HTTP requests, read more about postman here. Authentication Several of the exposed APIs requires various cookies, for instance authentication and gitea information. To be able to do requests against these APIs the cookies have to be included in the HTTP request, and configured in postman. The cookies can be found in the following way: In your browser login to dev. »