Skip to main content
GET
/
v1
/
subscribers
/
{subscriberId}
/
notifications
/
feed
PHP
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\SubscribersV1ControllerGetNotificationsFeedRequest(
    subscriberId: '<id>',
    page: 0,
    payload: 'btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=',
);

$response = $sdk->subscribers->notifications->getFeed(
    request: $request
);

if ($response->feedResponseDto !== null) {
    // handle response
}
{
  "hasMore": true,
  "data": [
    {
      "_id": "615c1f2f9b0c5b001f8e4e3b",
      "_templateId": "template_12345",
      "_environmentId": "env_67890",
      "_organizationId": "org_98765",
      "_notificationId": "notification_123456",
      "_subscriberId": "subscriber_112233",
      "_jobId": "job_778899",
      "transactionId": "transaction_123456",
      "content": "This is a test notification content.",
      "read": false,
      "seen": true,
      "archived": false,
      "cta": {
        "type": "redirect",
        "data": {
          "url": "<string>"
        },
        "action": {
          "buttons": [
            {
              "content": "<string>",
              "resultContent": "<string>"
            }
          ],
          "result": {
            "payload": {}
          }
        }
      },
      "status": "sent",
      "_messageTemplateId": "message_template_54321",
      "_feedId": "feed_445566",
      "createdAt": "2024-12-10T10:10:59.639Z",
      "updatedAt": "2024-12-10T10:10:59.639Z",
      "actor": {
        "data": null
      },
      "subscriber": {
        "subscriberId": "<string>",
        "_id": "<string>",
        "firstName": "<string>",
        "lastName": "<string>",
        "avatar": "<string>"
      },
      "templateIdentifier": "template_abcdef",
      "providerId": "provider_xyz",
      "subject": "Test Notification Subject",
      "deviceTokens": [
        "token1",
        "token2"
      ],
      "payload": {
        "key": "value"
      },
      "data": {
        "key": "value"
      },
      "overrides": {
        "overrideKey": "overrideValue"
      },
      "tags": [
        "tag1",
        "tag2"
      ]
    }
  ],
  "pageSize": 2,
  "page": 1,
  "totalCount": 5
}

Authorizations

Authorization
string
header
required

API key authentication. Allowed headers-- "Authorization: ApiKey <novu_secret_key>".

Headers

idempotency-key
string

A header for idempotency purposes

Path Parameters

subscriberId
string
required

Query Parameters

page
number
Required range: x >= 0
limit
number
default:10
Required range: x <= 100
read
boolean
seen
boolean
payload
string

Base64 encoded string of the partial payload JSON object

Response

OK

hasMore
boolean
required

Indicates if there are more notifications to load.

Example:

true

data
object[]
required

Array of notifications returned in the response.

pageSize
number
required

The number of notifications returned in this response.

Example:

2

page
number
required

The current page number of the notifications.

Example:

1

totalCount
number

Total number of notifications available.

Example:

5