Skip to content

Latest commit

 

History

History
117 lines (81 loc) · 6.09 KB

File metadata and controls

117 lines (81 loc) · 6.09 KB

Notifications

Overview

Available Operations

  • list - List all events
  • get - Retrieve an event

list

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.

Example Usage

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
}

Parameters

Parameter Type Required Description
$request Operations\NotificationsControllerListNotificationsRequest ✔️ The request object to use for the request.

Response

?Operations\NotificationsControllerListNotificationsResponse

Errors

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 */*

get

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.

Example Usage

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
}

Parameters

Parameter Type Required Description
notificationId string ✔️ N/A
idempotencyKey ?string A header for idempotency purposes

Response

?Operations\NotificationsControllerGetNotificationResponse

Errors

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 */*