Sist endret: 2. apr. 2024

Translate-to-Norwegian

App Events

Introduction App Events is the support for Altinn Events within the application template, providing standard event functionality for the application developers. The functionality provided within the template is: Pushing events Enabling of standard events through configuration Pushing custom events through code Receiving events Subscribing to events Validate subscription Run custom code when receiving events Subscribing to events Subscring to events is descibed here Validate subscriptions Once the application succesfully have created a subscription, the Event Service will sende a ping event. »

Subscribing

Subscribing to events In order to receive events in the application you need create a subscription. While you can create a subscription authenticated as a user, most scenarios will probably be to authenticate as the organization owning the application, and to create the subscription as part of the startup process of the application. This example covers authenticating as an organization through maskinporten. You should first make sure you have a client definition registered in Maskinporten for your application. »

Altinn 3 API

De to primære datastrukturene Dette vil være en oversikt over primærmodellene som brukes i Altinn 3. Hovedhensikten med dette er å danne en grunnleggende forståelse av modellene før introduksjon av API-ene. En instans kan inneholde mange dataelementer. Hvert dataelement må referere til en enkelt datafil. Instans (Forekomst) Instansmodellen er hovedmetadatadokumentet i Altinn 3. Den brukes av Altinn for å holde styr på tilstanden til en interaksjon mellom en sluttbruker og eieren av en app. »

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. »

Instanser

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. »

Local development

Set up localtest according to the description in app-localtest When you get to step 2 - add the pdf profile to your docker command This ensures the new pdf service is created. docker compose --profile pdf --profile localtest up -d --build Add PdfGenerationSettings to you appsettings.Development.json file "PdfGeneratorSettings": { "ServiceEndpointUri": "http://local.altinn.cloud/pdfservice/pdf", "AppPdfPageUriTemplate": "http://{hostName}/{appId}/#/instance/{instanceId}?pdf=1", "WaitForSelector": "#readyForPrint" } Change the HostName under GeneralSettings in appsettings.json "GeneralSettings": { "HostName": "local.altinn.cloud" } This used to say altinn3local. »

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. »

Autentisering

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 registres 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? »