(subscribers.notifications)
- feed - Get in-app notification feed for a particular subscriber
- unseen_count - Get the unseen in-app notifications count for subscribers feed
Get in-app notification feed for a particular subscriber
from novu_py import Novu
import os
with Novu(
secret_key=os.getenv("NOVU_SECRET_KEY", ""),
) as novu:
res = novu.subscribers.notifications.feed(request={
"subscriber_id": "<id>",
"limit": 10,
"payload": "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=",
})
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.SubscribersV1ControllerGetNotificationsFeedRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.SubscribersV1ControllerGetNotificationsFeedResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 414 | application/json |
models.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.ErrorDto | 500 | application/json |
models.APIError | 4XX, 5XX | */* |
Get the unseen in-app notifications count for subscribers feed
from novu_py import Novu
import os
with Novu(
secret_key=os.getenv("NOVU_SECRET_KEY", ""),
) as novu:
res = novu.subscribers.notifications.unseen_count(subscriber_id="<id>", seen=False, limit=100)
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
subscriber_id |
str | ✔️ | N/A |
seen |
Optional[bool] | ➖ | Indicates whether to count seen notifications. |
limit |
Optional[float] | ➖ | The maximum number of notifications to return. |
idempotency_key |
Optional[str] | ➖ | A header for idempotency purposes |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.SubscribersV1ControllerGetUnseenCountResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorDto | 414 | application/json |
models.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
models.ValidationErrorDto | 422 | application/json |
models.ErrorDto | 500 | application/json |
models.APIError | 4XX, 5XX | */* |