Cancel notification order
Endpoint for stopping the sending of a registered notification order.
Endpoint
PUT /order/{id}/cancel
The {id} represents the unique identifier of the notification order for which notifications are to be cancelled.
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 notification order was cancelled. No notifications will be sent.
- 404 Not Found: No order matching the provided ID was found.
- 401 Unauthorized: Indicates a missing, invalid or expired authorization header.
- 403 Forbidden: Indicates missing or invalid scope or Platform Access Token.
- 409 Conflict: The order cannot be cancelled due to current processing status.
Content-Type
- application/json
Response body
The response body is formatted as an NotificationOrderWithStatusExt.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.
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.
creator
Type: string
The abbreviated name of the entity or person who created the notification order.
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 the 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.
processingStatus
Type: StatusExt
A status object describing the processing status of the notification order containing the properties below.
- status: current processing status.
- description: an English description of the status and a timestamp.
- lastUpdate: The date and time at which the status was most recently updated.
Status | Description |
---|---|
Registered | The order has been registered and is pending the requested send time to begin processing. |
Processing | The order is currently being processed, and notifications are actively being generated. |
Completed | The order processing has been completed, and all notifications have been successfully generated. |
Cancelled | The order processing was stopped because the order was cancelled. |
Examples
Request
curl --location 'https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1/cancel' \
--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 status information.
Example: Successfully cancelled order response.
{
"id": "f1a1cc30-197f-4f34-8304-006ce4945fd1",
"sendersReference": "ref-2023-12-01",
"requestedSendTime": "2023-12-12T14:13:27.836731Z",
"creator": "digdir",
"created": "2023-12-12T14:13:27.845029Z",
"notificationChannel": "Email",
"processingStatus": {
"status": "Cancelled",
"description": "Order processing was stopped due to order being cancelled.",
"lastUpdate": "2023-12-12T14:13:27.845029Z"
}
}
40x responses
Response body contains the problem details and status code
Example: 404 response body
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.5",
"title": "Not Found",
"status": 404,
"traceId": "00-5249d76c03c137205ad8976fd9cd2e64-4d97ca7aea3f7489-00"
}