curl --request GET \
--url https://api.example.com/v2/received-text-messages{
"200": {},
"400": {},
"401": {},
"403": {},
"received_text_messages": [
{
"id": {},
"user_number": "<string>",
"notify_number": "<string>",
"content": "<string>",
"created_at": {},
"service_id": {}
}
],
"links": {
"current": "<string>",
"next": "<string>"
}
}Retrieve a list of text messages received by your service
curl --request GET \
--url https://api.example.com/v2/received-text-messages{
"200": {},
"400": {},
"401": {},
"403": {},
"received_text_messages": [
{
"id": {},
"user_number": "<string>",
"notify_number": "<string>",
"content": "<string>",
"created_at": {},
"service_id": {}
}
],
"links": {
"current": "<string>",
"next": "<string>"
}
}This endpoint retrieves all text messages received by your service. Messages are returned in descending order by creation date (newest first).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/alphagov/notifications-api/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer {api_key}
id of the last message from the previous response. This returns messages created before the specified message.If omitted, returns the most recent messages.Show Message object properties
2024-03-15T14:30:00.000000Zcurl -X GET "https://api.notifications.service.gov.uk/v2/received-text-messages" \
-H "Authorization: Bearer {api_key}"
{
"received_text_messages": [
{
"id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
"user_number": "447700900111",
"notify_number": "447700900000",
"content": "Hello, I'd like to enquire about my application",
"created_at": "2024-03-15T14:30:00.000000Z",
"service_id": "12345678-90ab-cdef-1234-567890abcdef"
},
{
"id": "b2c3d4e5-f678-90a1-b2c3-d4e5f6789012",
"user_number": "447700900222",
"notify_number": "447700900000",
"content": "Thank you for your help",
"created_at": "2024-03-15T14:25:00.000000Z",
"service_id": "12345678-90ab-cdef-1234-567890abcdef"
}
],
"links": {
"current": "https://api.notifications.service.gov.uk/v2/received-text-messages",
"next": "https://api.notifications.service.gov.uk/v2/received-text-messages?older_than=b2c3d4e5-f678-90a1-b2c3-d4e5f6789012"
}
}
API_PAGE_SIZE configuration setting.
To retrieve the next page of results:
id of the last message in the current responseolder_than parameter set to that idnext link is not present in the response# Get first page
curl -X GET "https://api.notifications.service.gov.uk/v2/received-text-messages" \
-H "Authorization: Bearer {api_key}"
# Get next page using the id from the last message
curl -X GET "https://api.notifications.service.gov.uk/v2/received-text-messages?older_than=b2c3d4e5-f678-90a1-b2c3-d4e5f6789012" \
-H "Authorization: Bearer {api_key}"
older_than UUID or include unexpected query parameters.{
"status_code": 400,
"errors": [
{
"error": "ValidationError",
"message": "Additional properties are not allowed (invalid_param was unexpected)"
}
]
}
created_at (newest first)