Last modified: Jan 16, 2025

Get email notifications

Endpoint for retrieving the send status of all email notifications generated by a notification order.

Endpoint

GET /order/{id}/notifications/email

The {id} represents the unique identifier of the notification order for which notifications are to be retrieved.

Authentication

This API requires authentication, and the request must include one of the following:

  • Maskinporten scope altinn:serviceowner/notifications.create (for external system callers)
  • Platform Access Token (for Altinn Apps and internal Altinn systems)

See Authentication and Authorization for more information.

Response

Response codes

  • 200 OK: The email notifications were successfully retrieved.
  • 404 Not Found: No order matching the provided ID was found. Refer to the problem details in the response body for further information.
  • 401 Unauthorized: Indicates a missing, invalid or expired authorization header.
  • 403 Forbidden: Indicates missing or invalid scope or Platform Access Token.

Content-Type

  • application/json

Response body

The response body is formatted as an EmailNotificationSummaryExt and serialized as a JSON string.

Response body properties

orderId

Type: Globally Unique Identifier (GUID)

The ID of the notification order to which the retrieved notifications are associated.

sendersReference

Type: string

The sender’s reference provided by the creator in the notification order request.

generated

Type: int

The total number of email notifications generated so far based on the notification order.

succeeded

Type: int

The number of email notifications that have been successfully sent so far.

notifications

Type: List of EmailNotificationWithResult

A list of generated notifications with their send results. Each notification will include the following properties:

  • id: The ID of the notification.
  • succeeded: A boolean indicating whether the notification was sent successfully.
  • recipient: The contact details of the recipient to whom the notification was sent.
  • sendStatus: The status of the notification’s delivery.
StatusDescription
NewThe email has been created but has not yet been picked up for processing.
SendingThe email is being processed and will be sent shortly.
SucceededThe email has been accepted by the third-party service and will be sent soon.
DeliveredThe email was successfully delivered to the recipient. No errors were reported, indicating successful delivery.
FailedThe email was not sent due to an unspecified failure.
Failed_RecipientNotIdentifiedThe email was not sent because the recipient’s email address could not be found.
Failed_InvalidEmailFormatThe email was not sent due to an invalid email address format.
Failed_BouncedThe email bounced due to issues like a non-existent email address or invalid domain.
Failed_FilteredSpamThe email was identified as spam and rejected or blocked (not quarantined).
Failed_QuarantinedThe email was quarantined due to being flagged as spam, bulk mail, or phishing.

Examples

In the example below we have included placeholders for both the Platform Access and Altinn Token. You only need one of them, see the Authentication section for which one applies to your use case.

Request

curl --location 'https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1/notifications/email' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [INSERT ALTINN TOKEN]' \
--header 'PlatformAccessToken: [INSERT PLATFORM ACCESS TOKEN]'

Response

200 OK

Response body contains the email notification summary.

{
    "orderId": "f1a1cc30-197f-4f34-8304-006ce4945fd1",
    "sendersReference": "ref-2023-12-01",
    "generated": 1,
    "succeeded": 0,
    "notifications": [
        {
            "id": "e0197ec7-3d82-4917-8329-8c9ecc4c569b",
            "succeeded": false,
            "recipient": {
                "emailAddress": "recipient@domain.com"
            },
            "sendStatus": {
                "status": "New",
                "description": "The email has been created, but has not been picked up for processing yet.",
                "lastUpdate": "2023-11-14T16:06:02.877361Z"
            }
        }
    ]
}

404 Not Found

An empty response is returned with the 404 status code.