Skip to content

Latest commit

 

History

History
134 lines (88 loc) · 7.36 KB

README.md

File metadata and controls

134 lines (88 loc) · 7.36 KB

Messages

(messages)

Overview

A message in Novu represents a notification delivered to a recipient on a particular channel. Messages contain information about the request that triggered its delivery, a view of the data sent to the recipient, and a timeline of its lifecycle events. Learn more about messages. https://docs.novu.co/workflows/messages

Available Operations

retrieve

Returns a list of messages, could paginate using the page query parameter

Example Usage

from novu_py import Novu
import os

with Novu(
    api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:

    res = novu.messages.retrieve()

    # Handle response
    print(res)

Parameters

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

Response

models.MessagesControllerGetMessagesResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 400, 404, 409 application/json
models.ValidationErrorDto 422 application/json
models.APIError 4XX, 5XX */*

delete

Deletes a message entity from the Novu platform

Example Usage

from novu_py import Novu
import os

with Novu(
    api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:

    res = novu.messages.delete(message_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
message_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessagesControllerDeleteMessageResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 400, 404, 409 application/json
models.ValidationErrorDto 422 application/json
models.APIError 4XX, 5XX */*

delete_by_transaction_id

Deletes messages entity from the Novu platform using TransactionId of message

Example Usage

from novu_py import Novu
import os

with Novu(
    api_key=os.getenv("NOVU_API_KEY", ""),
) as novu:

    res = novu.messages.delete_by_transaction_id(transaction_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
transaction_id str ✔️ N/A
channel Optional[models.QueryParamChannel] The channel of the message to be deleted
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessagesControllerDeleteMessagesByTransactionIDResponse

Errors

Error Type Status Code Content Type
models.ErrorDto 400, 404, 409 application/json
models.ValidationErrorDto 422 application/json
models.APIError 4XX, 5XX */*