class SimpleSpark::Endpoints::Events
Provides access to the /message-events endpoint @note See: developers.sparkpost.com/api/events/
Attributes
client[RW]
Public Class Methods
new(client)
click to toggle source
# File lib/simple_spark/endpoints/events.rb, line 8 def initialize(client) @client = client end
Public Instance Methods
samples(events = nil)
click to toggle source
Returns sample 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 Event hash objects @note See: developers.sparkpost.com/api/events/#events-get-events-samples
# File lib/simple_spark/endpoints/events.rb, line 17 def samples(events = nil) query_params = events.nil? ? {} : { events: events } @client.call(method: :get, path: 'events/message/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 Event hash objects @note developers.sparkpost.com/api/events/#events-get-search-for-message-events
# File lib/simple_spark/endpoints/events.rb, line 26 def search(params = {}) @client.call(method: :get, path: 'events/message', query_values: params) end