Class: Notiflows::Resources::Deliveries

Inherits:
Object
  • Object
show all
Defined in:
lib/notiflows/resources/deliveries.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Deliveries

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Deliveries.

Parameters:



72
73
74
# File 'lib/notiflows/resources/deliveries.rb', line 72

def initialize(client:)
  @client = client
end

Instance Method Details

#list(after: nil, before: nil, channel_id: nil, created_after: nil, created_before: nil, limit: nil, status: nil, topic: nil, request_options: {}) ⇒ Notiflows::Internal::CursorPage<Notiflows::Models::Delivery>

Retrieve a paginated list of all deliveries in your project.

A delivery represents a single attempt to send a notification through a specific channel. Use filters to narrow down results by channel, status, or time range.

Parameters:

  • after (String) —

    Cursor for fetching the next page

  • before (String) —

    Cursor for fetching the previous page

  • channel_id (String) —

    Filter by channel ID (UUID)

  • created_after (String) —

    Filter by created after (ISO 8601 datetime)

  • created_before (String) —

    Filter by created before (ISO 8601 datetime)

  • limit (Integer) —

    Number of items per page (default: 25, max: 1000)

  • status (String) —

    Filter by status (pending, sent, failed)

  • topic (String) —

    Filter by topic name

  • request_options (Notiflows::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/notiflows/resources/deliveries.rb', line 57

def list(params = {})
  parsed, options = ::Notiflows::DeliveryListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "deliveries",
    query: parsed,
    page: ::Notiflows::Internal::CursorPage,
    model: ::Notiflows::Delivery,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Notiflows::Models::Delivery

Retrieve details of a single delivery attempt.

Includes the rendered content (data), channel information, and all timestamp tracking (sent, seen, read, clicked, archived).

Parameters:

Returns:

See Also:



20
21
22
23
24
25
26
27
# File 'lib/notiflows/resources/deliveries.rb', line 20

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["deliveries/%1$s", id],
    model: ::Notiflows::Delivery,
    options: params[:request_options]
  )
end