Events
Learn about how Dialogporten integrates with Altinn Events
Introduction
Dialogporten offers mechanisms that enable end-user and service owner systems to detect changes made to dialogs, eliminating the need to regularly poll the dialog list for changes.
Events refer to technical application events generated by Dialogporten (or the service provider) and published through the Event component in Altinn. Events can be consumed by authorized parties and the service provider, according to the authorization rules defined by the service provider.
How Dialogporten utilizes events
Dialogporten will automatically publish events of predefined types for all changes in Dialogporten, including the creation of and updates to the dialog and its transmissions and activities. The authorization policy associated with the main service resource governs who is allowed to consume these events on behalf of the organization or citizen “owning” the dialog.
Dialogporten will also produce events whenever a dialog, or a dialog change, is first seen, i.e., when the details of a single dialog are retrieved from the API. Seen events are not emitted as a result of requests to the search or list API.
All events refer to the dialog they are related to, and some events contain additional metadata that allows end-user systems and service provider systems to build business logic associated with a particular state change or activity performed on a dialog.
How service providers and end-user system providers can utilize events
Altinn Events supports (and strongly encourages) the use of “subscriptions” when consuming events, which uses a webhook/push-based approach of distributing event notifications.
One of the main advantages of using events this way is the ability to react to new or changed information without the need for frequent and constant “polling”, i.e., making repeated requests to an endpoint at a typically very short interval to check whether changes have occurred. By contrast, using webhooks eliminates this wasteful approach by “reversing the API”; Dialogporten and Events notify authorized subscribers as soon as a change occurs.
Use cases include:
- End-user systems monitoring if new dialogs of a particular type are created
- End-user systems monitoring if updates to an existing dialog are made by the service provider
- A service owner acting on the user having seen or opened a dialog in order to determine the need for sending reminders
- A second service owner, granted access to consume events associated with a particular service process reaching an end state, using these events as a trigger to initiate a related business process proactively without user interaction
Low latency per-dialog update detection for GUIs
Dialogporten supports a custom update subscription protocol, which uses GraphQL subscriptions supplied directly by Dialogporten. This is useful for online, interactive GUIs where the user is present, and enables the system to monitor a single dialog for updates.
Typically this is used to enable GUIs to notify the end user immediately if a currently accessed/opened dialog has been changed, which is useful when dealing with state changing write actions.
Read more