Last modified: Aug 12, 2024

Altinn 3 Broker Developer guides

How to get started subscribing to Events from Altinn 3 Broker, for developers

    This section of the documentation is a work in progress, and as such currently makes extensive reference to external sources.
    Currently the Events for Broker are not ready for full-scale use, due to pending changes in Altinn Events and Authorization. This documents the expected scenario, but may be subject to change.

    In order to use events/webhooks for a Broker resource, you need to setup a subscription for the given resource. This subscription is used to configure the endpoint where the events published by broker end up. You can read more about how to setup an Events subscription in Altinn Events here.

    All Events published by Altinn Broker follow the same pattern:

    {
     "id": "1faa107f-3c0a-4fa6-9fce-7cee8838e258",
     "resource": "urn:altinn:resource:altinn-broker-test-resource-1",
     "resourceinstance": "da4ceacc-ad44-4e54-99b6-b58e3c13c785",
     "source": "https://platform.tt02.altinn.no/broker/api/v1/filetransfer",
     "specversion": "1.0",
     "type": "no.altinn.broker.Published",
     "subject": "/party/50015641",
     "alternativesubject": "/organisation/123456789",
     "time": "2024-04-19T07:22:19.438039Z"
    }
    

    Event Subscription

    This subscription is used to configure the endpoint where the events published by broker end up. You can read more about how to setup an Events subscription in Altinn Events here.

    You are required to set up the following filters:

    Alternativesubjectfilter is used to restrict the event to only the authorized sender or recipient for that particular event, this ensures security and reduces visibility.

    Resourceinstance will always be the same as the FileTransferId of the FileTransfer.

    In addition you may wish to use filters for Type, so that you receive the event types you are interested in/can perform actions on. If you do not specify a Type Filter you will receive all the different types of events if you have access to them.

    For Senders:

    • no.altinn.broker.filetransferinitialized
    • no.altinn.broker.uploadprocessing
    • no.altinn.broker.uploadfailed
    • no.altinn.broker.allconfirmeddownloaded
    • no.altinn.broker.filepurged

    For both Senders And Recipients:

    • no.altinn.broker.published
    • no.altinn.broker.downloadconfirmed
    • no.altinn.broker.fileneverconfirmeddownloaded

    For further description of events and their usage, see send files and receive files developer guides, as these describe the events in relation to the respective roles/process.