Get SMS notifications
Endpoint for retrieving the send status of all SMS notifications generated by a notification order.
Endpoint
GET /order/{id}/notifications/sms
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 SMS 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 SmsNotificationSummaryExt 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 SMS notifications generated so far based on the notification order.
succeeded
Type: int
The number of SMS notifications that have been successfully sent so far.
notifications
Type: List<SmsNotificationWithResult>
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.
Status | Description |
---|---|
New | The SMS has been created but has not yet been picked up for processing. |
Sending | The SMS is being processed and will be sent shortly. |
Accepted | The SMS has been accepted by the gateway service and will be sent soon. |
Delivered | The SMS was successfully delivered to the recipient. |
Failed | The SMS was not sent due to an unspecified failure. |
Failed_BarredReceiver | The SMS was not delivered because the recipient’s mobile number is barred, blocked or not in use. |
Failed_Deleted | The SMS was not delivered because the message has been deleted. |
Failed_Expired | The SMS was not delivered because it has been expired. |
Failed_InvalidRecipient | The SMS was not sent because the recipient mobile number was invalid. |
Failed_Undelivered | The SMS was not delivered due to invalid mobile number or no available route to destination. |
Failed_RecipientNotIdentified | The SMS was not sent because the recipient’s SMS address was not found. |
Failed_Rejected | The SMS was not delivered because it was rejected. |
Examples
Request
curl --location 'https://platform.altinn.no/notifications/api/v1/orders/f1a1cc30-197f-4f34-8304-006ce4945fd1/notifications/sms' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer [INSERT ALTINN TOKEN]' \
--header 'PlatformAccessToken: [INSERT PLATFORM ACCESS TOKEN]'
Response
200 OK
Response body contains the sms 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": {
"mobileNumber": "+4799999999"
},
"sendStatus": {
"status": "New",
"description": "The sms 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.