List all notification events (triggered events) for the current environment. This API supports filtering by channels, templates, emails, subscriberIds, transactionId, topicKey, severity, contextKeys. Checkout all available filters in the query section. This API returns event triggers, to list each channel notifications, check messages APIs.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Operations;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$request = new Operations\NotificationsControllerListNotificationsRequest();
$response = $sdk->notifications->list(
request: $request
);
if ($response->activitiesResponseDto !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\NotificationsControllerListNotificationsRequest | ✔️ | The request object to use for the request. |
?Operations\NotificationsControllerListNotificationsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\ErrorDto | 414 | application/json |
| Errors\ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
| Errors\ValidationErrorDto | 422 | application/json |
| Errors\ErrorDto | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Retrieve an event by its unique key identifier notificationId. Here notificationId is of mongodbId type. This API returns the event details - execution logs, status, actual notification (message) generated by each workflow step.
declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$response = $sdk->notifications->get(
notificationId: '<id>'
);
if ($response->activityNotificationResponseDto !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
notificationId |
string | ✔️ | N/A |
idempotencyKey |
?string | ➖ | A header for idempotency purposes |
?Operations\NotificationsControllerGetNotificationResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\ErrorDto | 414 | application/json |
| Errors\ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
| Errors\ValidationErrorDto | 422 | application/json |
| Errors\ErrorDto | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |