Class: Coeus

Inherits:
Object
  • Object
show all
Defined in:
lib/coeus.rb

Class Method Summary collapse

Class Method Details

.send_event(integration_id, event_type, payload) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/coeus.rb', line 5

def self.send_event(integration_id, event_type, payload)

  data = {
    integration_id: integration_id,
    event: event_type,
    payload: payload
  }

  result = HTTParty.post(
    "https://getcoeus.com/api/v1/events",
    body: data.to_json,
    headers: {
      "Content-Type": "application/json"
    },
    verify: false
  )

  puts result.code
end