(subscribers.messages)
- 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 a subscriber messages as seen, read, unseen or unread
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)
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. |
models.SubscribersV1ControllerMarkMessagesAsResponse
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 | */* |
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.
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)
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. |
models.SubscribersV1ControllerMarkAllUnreadAsReadResponse
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 message action as seen
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)
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. |
models.SubscribersV1ControllerMarkActionAsSeenResponse
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 | */* |