Module: Teleflow::Api::Notification

Included in:
Client
Defined in:
lib/teleflow/api/notification.rb

Overview

Module Teleflow::Api::Notification provides an API for managing Notification in the Teleflow application.

This module includes methods for retrieving notifications, notifications stats and notifications graph stats.

For more information on the Teleflow API(api-teleflow.khulnasoft.com/api#/Notification), see docs.teleflow.khulnasoft.com/api/.

Instance Method Summary collapse

Instance Method Details

#notification(notification_id) ⇒ Hash, number

Returns a notification

@pathparams:

Parameters:

  • `notification_id` (String)

Returns:

  • (Hash)

    notification entity

  • (number)

    status

    • Returns 200 if successful.



58
59
60
# File 'lib/teleflow/api/notification.rb', line 58

def notification(notification_id)
  get("/notifications/#{notification_id}")
end

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

Returns a list of notifications 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:

  • `channels` (Array[String])

    Available values : in_app, email, sms, chat, push

  • `templates` (Array[String])
  • `emails` (Array[String])
  • `search` (String(optional))
  • `transactionId` (String(optional))
  • `page` (Integer(optional))

    Number of page for the pagination. Default value is 0

Returns:

  • (Hash)

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

  • (number)

    status

    • Returns 200 if successful.



25
26
27
# File 'lib/teleflow/api/notification.rb', line 25

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

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

Returns a list of notifications stats

@queryparams:

Parameters:

  • `days` (Integer)

Returns:

  • (Hash)

    notification graph stats.

  • (number)

    status

    • Returns 200 if successful.



46
47
48
# File 'lib/teleflow/api/notification.rb', line 46

def notifications_graph_stats(query = {})
  get("/notifications/graph/stats", query: query)
end

#notifications_statsHash, number

Returns a list of notifications stats

Returns:

  • (Hash)

    notification stats.

  • (number)

    status

    • Returns 200 if successful.



34
35
36
# File 'lib/teleflow/api/notification.rb', line 34

def notifications_stats
  get("/notifications/stats")
end