Class: LucidIntercom::PostRequest

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

Instance Method Summary collapse

Instance Method Details

#call(path, data) ⇒ Response

Parameters:

  • path (String)

    path relative to the domain

  • data (Hash)

Returns:



16
17
18
19
20
21
22
23
24
# File 'lib/lucid_intercom/post_request.rb', line 16

def call(path, data)
  res = HTTP.headers(
    'Authorization' => "Bearer #{LucidIntercom.access_token}",
    'Accept' => 'application/json',
    'Content-Type' => 'application/json'
  ).post("https://api.intercom.io/#{path}", json: data)

  Response.new(res.code)
end