Skip to content

Latest commit

 

History

History
155 lines (110 loc) · 10.6 KB

README.md

File metadata and controls

155 lines (110 loc) · 10.6 KB

NovuMessages

(subscribers.messages)

Overview

Available Operations

  • mark_all_as - Mark a subscriber messages as seen, read, unseen or unread
  • mark_all - Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.
  • update_as_seen - Mark message action as seen

mark_all_as

Mark a subscriber messages as seen, read, unseen or unread

Example Usage

import novu_py
from novu_py import Novu
import os

with Novu(
    secret_key=os.getenv("NOVU_SECRET_KEY", ""),
) as novu:

    res = novu.subscribers.messages.mark_all_as(subscriber_id="<id>", message_mark_as_request_dto={
        "message_id": "<id>",
        "mark_as": novu_py.MarkAs.UNREAD,
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
subscriber_id str ✔️ N/A
message_mark_as_request_dto models.MessageMarkAsRequestDto ✔️ N/A
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.SubscribersV1ControllerMarkMessagesAsResponse

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

mark_all

Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.

Example Usage

import novu_py
from novu_py import Novu
import os

with Novu(
    secret_key=os.getenv("NOVU_SECRET_KEY", ""),
) as novu:

    res = novu.subscribers.messages.mark_all(subscriber_id="<id>", mark_all_message_as_request_dto={
        "mark_as": novu_py.MarkAllMessageAsRequestDtoMarkAs.SEEN,
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
subscriber_id str ✔️ N/A
mark_all_message_as_request_dto models.MarkAllMessageAsRequestDto ✔️ N/A
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.SubscribersV1ControllerMarkAllUnreadAsReadResponse

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

update_as_seen

Mark message action as seen

Example Usage

import novu_py
from novu_py import Novu
import os

with Novu(
    secret_key=os.getenv("NOVU_SECRET_KEY", ""),
) as novu:

    res = novu.subscribers.messages.update_as_seen(request={
        "message_id": "<id>",
        "type": "<value>",
        "subscriber_id": "<id>",
        "mark_message_action_as_seen_dto": {
            "status": novu_py.MarkMessageActionAsSeenDtoStatus.DONE,
        },
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request models.SubscribersV1ControllerMarkActionAsSeenRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.SubscribersV1ControllerMarkActionAsSeenResponse

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