module Dialog::API::Event

Public Instance Methods

create_event(payload) click to toggle source

Creates an event @param payload [Hash] @return [Hash]

# File lib/dialog-api/api/event.rb, line 17
def create_event(payload)
  post("b/#{bot_id}/events", body: { event: payload })
end
event(name, interlocutor_distinct_id, properties) click to toggle source

Helper method to create an event @param name [String] Event name @param interlocutor_distinct_id [String] Interlocutor distinct Id @param properties [Hash] Event properties @return [Hash]

# File lib/dialog-api/api/event.rb, line 10
def event(name, interlocutor_distinct_id, properties)
  create_event({ name: name, created_at: Time.now.to_f, id: interlocutor_distinct_id, properties: properties })
end