Skip to content

Latest commit

 

History

History
142 lines (98 loc) · 11.3 KB

File metadata and controls

142 lines (98 loc) · 11.3 KB

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

Get

List all messages for the current environment. This API supports filtering by channel, subscriberId, and transactionId. This API returns a paginated list of messages.

Example Usage

using Novu;
using Novu.Models.Components;
using Novu.Models.Requests;
using System.Collections.Generic;

var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");

MessagesControllerGetMessagesRequest req = new MessagesControllerGetMessagesRequest() {
    ContextKeys = new List<string>() {
        "tenant:org-123",
        "region:us-east-1",
    },
};

var res = await sdk.Messages.GetAsync(req);

// handle response

Parameters

Parameter Type Required Description
request MessagesControllerGetMessagesRequest ✔️ The request object to use for the request.

Response

MessagesControllerGetMessagesResponse

Errors

Error Type Status Code Content Type
Novu.Models.Errors.ErrorDto 414 application/json
Novu.Models.Errors.ErrorDto 400, 401, 403, 404, 405, 409, 413, 415 application/json
Novu.Models.Errors.ValidationErrorDto 422 application/json
Novu.Models.Errors.ErrorDto 500 application/json
Novu.Models.Errors.APIException 4XX, 5XX */*

Delete

Delete a message entity from the Novu platform by messageId. This action is irreversible. messageId is required and of mongodbId type.

Example Usage

using Novu;
using Novu.Models.Components;

var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");

var res = await sdk.Messages.DeleteAsync(messageId: "507f1f77bcf86cd799439011");

// handle response

Parameters

Parameter Type Required Description Example
MessageId string ✔️ N/A 507f1f77bcf86cd799439011
IdempotencyKey string A header for idempotency purposes

Response

MessagesControllerDeleteMessageResponse

Errors

Error Type Status Code Content Type
Novu.Models.Errors.ErrorDto 414 application/json
Novu.Models.Errors.ErrorDto 400, 401, 403, 404, 405, 409, 413, 415 application/json
Novu.Models.Errors.ValidationErrorDto 422 application/json
Novu.Models.Errors.ErrorDto 500 application/json
Novu.Models.Errors.APIException 4XX, 5XX */*

DeleteByTransactionId

Delete multiple messages from the Novu platform using transactionId of triggered event. This API supports filtering by channel and delete all messages associated with the transactionId.

Example Usage

using Novu;
using Novu.Models.Components;

var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");

var res = await sdk.Messages.DeleteByTransactionIdAsync(transactionId: "507f1f77bcf86cd799439011");

// handle response

Parameters

Parameter Type Required Description Example
TransactionId string ✔️ N/A 507f1f77bcf86cd799439011
Channel MessagesControllerDeleteMessagesByTransactionIdQueryParamChannel The channel of the message to be deleted
IdempotencyKey string A header for idempotency purposes

Response

MessagesControllerDeleteMessagesByTransactionIdResponse

Errors

Error Type Status Code Content Type
Novu.Models.Errors.ErrorDto 414 application/json
Novu.Models.Errors.ErrorDto 400, 401, 403, 404, 405, 409, 413, 415 application/json
Novu.Models.Errors.ValidationErrorDto 422 application/json
Novu.Models.Errors.ErrorDto 500 application/json
Novu.Models.Errors.APIException 4XX, 5XX */*