Sist endret: 8. aug. 2024

Get order details

Endpoint for retrieving the details of a notification order including templates and recipients.

Endpoint

GET /order/{id}

{id} represents the ID of the notification order to retrieve details for.

Authentication

This API requires authentication and the request must also 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 notification order was successfully retrieved.
  • 404 Not Found: No order matching the provided ID were found. Refer to problem details in response body for further information.
  • 401 Unauthorized: Indicates a missing, invalid or expired authorization header.
  • 403 Forbidden: Indicates that required scope or Platform Access Token is missing or invalid.

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: Guid

The ID of the notification order.

creator

Type: string

The short name of the creator of the notification order.

sendersReference

Type: string

The senders reference the creator provided in the notification order request.

requestedSendTime

Type: DateTime

The date and time for when the notification generated by the order should be sent.

created

Type: DateTime

The date and time for when the notification order request was registered.

notificationChannel

Type: enum NotificationChannelExt

The notification channel used for the notifications sent can be Email or Sms.

ignoreReservation

Type: boolean

Whether an individuals KRR reservation status should be ignored.

resourceId

Type: string

The ID of the Altinn resource the notifications should be related to as the ID appears in the Altinn Resource Registry.

recipients

Type: List<RecipientExt>

A list of all provided recipients.

emailTemplate

Type: EmailTemplateExt

All the email template values used to generate notifications.

smsTemplate

Type: SmsTemplateExt

All the sms template values used to generate notifications.

Type: OrderResourceLinksExt

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

Examples

Request

In the example we have included place holders for both the Platform Access and Altinn token.

You only need one of them, reference Authentication for which one applies to your use case.

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

Response

200 OK

Response body contains the notification order with notification template.

Example: Email notification order with notification template.

{
    "id": "ca964629-fba5-48e6-80b3-d75502c08f5b",
    "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/ca964629-fba5-48e6-80b3-d75502c08f5b",
        "status": "https://platform.altinn.no/notifications/api/v1/orders/ca964629-fba5-48e6-80b3-d75502c08f5b/status"
    }
}

Example: Sms notification order with notification template.

{
    "id": "ca964629-fba5-48e6-80b3-d75502c08f5b",
    "creator": "ttd",
    "sendersReference": "demo-2023-01",
    "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/ca964629-fba5-48e6-80b3-d75502c08f5b",
        "status": "https://platform.altinn.no/notifications/api/v1/orders/ca964629-fba5-48e6-80b3-d75502c08f5b/status"
    }
}

404 Not Found

An empty response is returned with the 404 status code.