Notifications API
Content
Notifications collection:
Single notification:
Notifications collection
Notifications index
GET /api/notifications
This method needs permission
readonnotifications.
Get list of existing Notifications.
Request
| Index behaviour | Definition |
|---|---|
| Paginated by default | Yes |
| Sorting | id, type, read_at, created_at, updated_at |
| Filters | id:enum, type:string, read_at:date, created_at:date, updated_at:date |
| Embedded |
GET /api/notifications HTTP/1.1
Responses
200 OK
GET /api/notifications HTTP/1.1
Content-Type: application/json
Status-Code: 200
{
"items": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "App\\Containers\\Tasks\\Notifications\\TaskPastDeadlineNotification",
"data": {
"id": "14443236-342a-4de1-acb9-fcabc0b19334",
"type": "notification.task_past_deadline",
"task_id": 1,
"task_name": "Collect client requirements"
},
"read_at": null,
"created_at": "2022-04-28T13:25:12+0200",
"_links": [
{
"href": "/api/v0/notifications/123e4567-e89b-12d3-a456-426614174000",
"rel": "self",
"type": "GET"
}
]
}
]
}
Latest Notifications
GET /api/latest-notifications
This method needs permission
readonnotifications.
Get list of recent Notifications.
Request
NOTE: You can specify amount of recent notification, which will be returned. In order to make the query fast, use query parameter
limit.
| Index behaviour | Definition |
|---|---|
| Paginated by default | No |
| Sorting | -- |
| Filters | -- |
| Embedded | -- |
GET /api/latest-notifications?limit=1000 HTTP/1.1
Responses
200 OK
{
"items": [
{
"id": "ffa8ec02-da98-4402-8744-b96843c2be08",
"type": "App\\Containers\\ApiServices\\GoodDayApiWebhooks\\Notifications\\GoodDayWebhookNotification",
"data": {
"id": "ffa8ec02-da98-4402-8744-b96843c2be08",
"type": "notifications.gd_webhook_service_unavailable",
"hours_without_webhook": 2,
"last_webhook_time": "2025-01-27T11:20:03.096985Z"
},
"read_at": null,
"created_at": "2025-01-27T12:20:10+0100",
"updated_at": "2025-01-27T12:20:10+0100",
"_links": [
{
"href": "/api/v0/notifications/ffa8ec02-da98-4402-8744-b96843c2be08",
"rel": "self",
"type": "GET"
}
]
},
{
"id": "ff5b4dfd-4d31-44f9-bd64-b150cb766140",
"type": "App\\Containers\\ApiServices\\GoodDayApiWebhooks\\Notifications\\GoodDayWebhookNotification",
"data": {
"id": "ff5b4dfd-4d31-44f9-bd64-b150cb766140",
"type": "notifications.gd_webhook_service_unavailable",
"hours_without_webhook": 2,
"last_webhook_time": "2025-01-27T11:20:03.096985Z"
},
"read_at": null,
"created_at": "2025-01-27T12:20:10+0100",
"updated_at": "2025-01-27T12:20:10+0100",
"_links": [
{
"href": "/api/v0/notifications/ff5b4dfd-4d31-44f9-bd64-b150cb766140",
"rel": "self",
"type": "GET"
}
]
},
...
]
}
Single notification
Notification detail
GET /api/notifications/{notification_id}
This method needs permission
accessonnotifications.
Get Notification detail.
Request
GET /api/notifications/123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Responses
200 OK
GET /api/notifications/123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Content-Type: application/json
Status-Code: 200
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "App\\Containers\\Tasks\\Notifications\\TaskPastDeadlineNotification",
"data": {
"id": "14443236-342a-4de1-acb9-fcabc0b19334",
"type": "notification.task_past_deadline",
"task_id": 1,
"task_name": "Collect client requirements"
},
"read_at": "2022-04-28T13:25:12+0200",
"created_at": "2022-04-28T13:25:12+0200",
"_links": [
{
"href": "/api/v0/notifications/123e4567-e89b-12d3-a456-426614174000",
"rel": "self",
"type": "GET"
}
]
}
404 NOT FOUND
Notification was not found.
GET /api/notifications/2 HTTP/1.1
Content-Type: application/json
Status-Code: 404
{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}
Mark notification as read
POST /api/notifications/{notification_id}/read
This method needs permission
updateonnotifications.
Method for marking Notification as read.
Request
POST /api/notifications/123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Content-Type: application/json
{
}
Responses
200 OK
Notification successfully updated.
PUT /api/notifications/1 HTTP/1.1
Content-Type: application/json
Status-Code: 200
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "App\\Containers\\Tasks\\Notifications\\TaskPastDeadlineNotification",
"data": {
"id": "14443236-342a-4de1-acb9-fcabc0b19334",
"type": "notification.task_past_deadline",
"task_id": 1,
"task_name": "Collect client requirements"
},
"read_at": "2022-04-28T13:25:12+0200",
"created_at": "2022-04-28T13:25:12+0200",
"_links": [
{
"href": "/api/v0/notifications/123e4567-e89b-12d3-a456-426614174000",
"rel": "self",
"type": "GET"
}
]
}
404 NOT FOUND
Notification was not found.
PUT /api/notifications/2 HTTP/1.1
Content-Type: application/json
Status-Code: 404
{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}
Mark multiple notifications as read
POST /api/notifications
This method needs permission
updateonnotifications.
Method for marking Notification as read.
Request
POST /api/notifications HTTP/1.1
Content-Type: application/json
{
"notification_ids": ["123e4567-e89b-12d3-a456-426614174000", "005cdb5f-cc43-4212-bc31-8ab1e19f8460"]
}
Responses
200 OK
Notification successfully updated.
POST /api/notifications HTTP/1.1
Content-Type: application/json
Status-Code: 200
{
"items": [
{
"id": "0003b57a-a9bd-4073-b172-650fe4afedd8",
"type": "App\\Containers\\Tasks\\Notifications\\TaskEstimateExceeded100PercentNotification",
"data": {
"id": "0003b57a-a9bd-4073-b172-650fe4afedd8",
"type": "notification.task_estimate_exceeded_100_percent",
"task_id": 976,
"task_name": "Kódování"
},
"read_at": "2023-03-06T15:36:47.000000Z",
"created_at": "2023-01-18T15:55:15+0100",
"updated_at": "2023-03-06T16:36:47+0100",
"_links": [
{
"href": "/api/v0/notifications/0003b57a-a9bd-4073-b172-650fe4afedd8",
"rel": "self",
"type": "GET"
}
]
},
{
"id": "005cdb5f-cc43-4212-bc31-8ab1e19f8460",
"type": "App\\Containers\\Tasks\\Notifications\\TaskEstimateExceeded100PercentNotification",
"data": {
"id": "005cdb5f-cc43-4212-bc31-8ab1e19f8460",
"type": "notification.task_estimate_exceeded_100_percent",
"task_id": 2093,
"task_name": "Rozšíření bleskovek [BE]"
},
"read_at": "2023-03-06T15:36:47.000000Z",
"created_at": "2023-01-18T16:11:48+0100",
"updated_at": "2023-03-06T16:36:47+0100",
"_links": [
{
"href": "/api/v0/notifications/005cdb5f-cc43-4212-bc31-8ab1e19f8460",
"rel": "self",
"type": "GET"
}
]
}
]
}