Module: Novu::Api::Messages

Included in:
Client
Defined in:
lib/novu/api/messages.rb

Overview

Module Novu::Api::Messages provides an API for managing messages in the Novu application.

This module includes methods for retrieving, and deleting messages.

For more information on the Novu API(https://api.novu.co/api#/Messages), see https://docs.novu.co/api/get-messages/.

Instance Method Summary collapse

Instance Method Details

#delete_message(message_id) ⇒ Hash, number

Deletes a message entity from the Novu platform

@pathparams:

Parameters:

  • The ID of the message to delete.

Returns:

  • of acknowledged and status.

  • status

    • Returns 200 if the message has been deleted correctly.


35
36
37
# File 'lib/novu/api/messages.rb', line 35

def delete_message(message_id)
  delete("/messages/#{message_id}")
end

#messages(query = {}) ⇒ Hash, number

Returns a list of messages that can be paginated using the page query parameter and filtered by the environment where it is executed from the organization the user belongs to.

@queryparams:

Parameters:

  • Number of page for the pagination. The page to fetch, defaults to 0.

  • The number of messages to fetch, defaults to 10.

  • The channel for the messages you wish to list.

  • The subscriberId for the subscriber you like to list messages for.

Returns:

  • The list of messages that match the criteria of the query params are successfully returned.

  • status

    • Returns 200 if successful


23
24
25
# File 'lib/novu/api/messages.rb', line 23

def messages(query = {})
  get("/messages", query: query)
end