Sist endret: 16. jan. 2025

Get order details

Endpoint for retrieving details of a notification order, including its template and recipients.

Endpoint

GET /order/{id}

The {id} represents the unique identifier of the notification order for which details 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 details of the notification order 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 NotificationOrderExt.cs and serialized as a JSON string.

Find a short description of each property below.

id

Type: Globally Unique Identifier (GUID)

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

creator

Type: string

The abbreviated name of the entity or person who created the notification order.

sendersReference

Type: string

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

requestedSendTime

Type: DateTime

The date and time at which the notifications generated by the order are scheduled to be sent to the recipients.

created

Type: DateTime

The date and time at which the notification order request was registered.

notificationChannel

Type: enum NotificationChannel

The notification channel used to deliver the notification to recipient. It can be either Email or SMS.

ignoreReservation

Type: boolean

Determines whether an individual’s KRR reservation status should be ignored.

resourceId

Type: string

The unique identifier of the Altinn resource to which the notifications are associated, as it is listed in the Altinn Resource Registry.

recipients

Type: List of RecipientExt

A list containing one or more recipient objects, where each recipient includes a national identity number, an organization number, an email address, or a mobile number.

emailTemplate

Type: EmailTemplateExt

The email template used to generate email notifications.

smsTemplate

Type: SmsTemplateExt

The SMS template used to generate SMS notifications.

Type: OrderResourceLinksExt

An object containing a set of self links for the notification order.

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' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [INSERT ALTINN TOKEN]' \
--header 'PlatformAccessToken: [INSERT PLATFORM ACCESS TOKEN]'

Response

200 OK

Response body contains the notification order with notification template and recipients.

Example Response: The following response illustrates a notification order designed to send an email to a single recipient.

{
    "id": "f1a1cc30-197f-4f34-8304-006ce4945fd1",
    "creator": "ttd",
    "sendersReference": "demo-2023-01",
    "requestedSendTime": "2023-12-12T14:13:27.8367317Z",
    "created": "2023-12-12T14:13:27.8450294Z",
    "notificationChannel": "Email",
    "recipients": [
        {
            "emailAddress": "testuser_1@altinn.no"
        }
    ],
    "emailTemplate": {
        "fromAddress": "noreply@altinn.no",
        "subject": "A test email from Altinn Notifications",
        "body": "A message sent from an application owner through Altinn.",
        "contentType": "Plain"
    },
    "links": {
        "self": "https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1",
        "status": "https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1/status"
    }
}

Example Response: The following response illustrates a notification order designed to send a customized email to a single recipient.

{
    "id": "f1a1cc30-197f-4f34-8304-006ce4945fd1",
    "creator": "ttd",
    "sendersReference": "demo-2023-02",
    "requestedSendTime": "2023-12-12T14:13:27.8367317Z",
    "created": "2023-12-12T14:13:27.8450294Z",
    "notificationChannel": "Email",
    "recipients": [
        {
            "organizationNumber":"311000179"
        }
    ],
    "emailTemplate": {
        "fromAddress": "noreply@altinn.no",
        "subject": "Important notification regarding your organization, $recipientName$",
        "body": "Dear $recipientName$, this is an official notification regarding your organization, identified by the organization number $recipientNumber$. Please take the necessary actions.",
        "contentType": "Plain"
    },
    "links": {
        "self": "https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1",
        "status": "https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1/status"
    }
}

Example Response: The following response shows a notification order intended to send an SMS to a single recipient.

{
    "id": "f1a1cc30-197f-4f34-8304-006ce4945fd1",
    "creator": "ttd",
    "sendersReference": "demo-2023-03",
    "requestedSendTime": "2023-12-12T14:13:27.8367317Z",
    "created": "2023-12-12T14:13:27.8450294Z",
    "notificationChannel": "Sms",
    "recipients": [
        {
            "mobileNumber": "+4799999999"
        }
    ],
    "smsTemplate": {
        "senderNumber": "Altinn",
        "body": "A text message sent by a service owner through Altinn."
    },
    "links": {
        "self": "https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1",
        "status": "https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1/status"
    }
}

Example Response: The following response shows a notification order designed to send a customized SMS to a single recipient.

{
    "id": "f1a1cc30-197f-4f34-8304-006ce4945fd1",
    "creator": "ttd",
    "sendersReference": "demo-2023-04",
    "requestedSendTime": "2023-12-12T14:13:27.8367317Z",
    "created": "2023-12-12T14:13:27.8450294Z",
    "notificationChannel": "Sms",
    "recipients": [
        {
            "organizationNumber":"311000179"
        }
    ],
    "smsTemplate": {
        "senderNumber": "Altinn",
        "body": "Dear $recipientName$, this is an official notification regarding your organization, identified by the organization number $recipientNumber$. Please take the necessary actions."
    },
    "links": {
        "self": "https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1",
        "status": "https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1/status"
    }
}

404 Not Found

An empty response is returned with the 404 status code.