Skip to content

Latest commit

 

History

History
100 lines (69 loc) · 7.09 KB

README.md

File metadata and controls

100 lines (69 loc) · 7.09 KB

NovuNotifications

(subscribers.notifications)

Overview

Available Operations

  • feed - Get in-app notification feed for a particular subscriber
  • unseen_count - Get the unseen in-app notifications count for subscribers feed

feed

Get in-app notification feed for a particular subscriber

Example Usage

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)

Parameters

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.

Response

models.SubscribersV1ControllerGetNotificationsFeedResponse

Errors

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

unseen_count

Get the unseen in-app notifications count for subscribers feed

Example Usage

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)

Parameters

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.

Response

models.SubscribersV1ControllerGetUnseenCountResponse

Errors

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