class SimpleSpark::Endpoints::MessageEvents
Provides access to the /message-events endpoint @note See: developers.sparkpost.com/api/#/reference/message-events
Attributes
client[RW]
Public Class Methods
new(client)
click to toggle source
# File lib/simple_spark/endpoints/message_events.rb, line 8 def initialize(client) @client = client end
Public Instance Methods
samples(events = nil)
click to toggle source
Returns sample message_events @param events [String] Event types for which to get a sample payload, use the Webhooks
Events
endpoint to list the
available event types, defaults to all event types
@return [Array] a list of sample MessageEvent hash objects @note See: developers.sparkpost.com/api/#/reference/message-events/events-samples
# File lib/simple_spark/endpoints/message_events.rb, line 17 def samples(events = nil) query_params = events.nil? ? {} : { events: events } @client.call(method: :get, path: 'message-events/events/samples', query_values: query_params) end
search(params = {})
click to toggle source
Perform a filtered search for message event data. The response is sorted by descending timestamp. @param params [String] Params to use in the search @return [Array] a list of MessageEvent hash objects @note See: developers.sparkpost.com/api/#/reference/message-events/search-for-message-events
# File lib/simple_spark/endpoints/message_events.rb, line 26 def search(params = {}) @client.call(method: :get, path: 'message-events', query_values: params) end