Class: FaxplusApi::Webhook

Inherits:
Base
  • Object
show all
Defined in:
lib/faxplus_api/webhook.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #make_request

Constructor Details

This class inherits a constructor from FaxplusApi::Base

Instance Method Details

#create(url: "#{@base_url}/hooks", data: {}) ⇒ Object



9
10
11
# File 'lib/faxplus_api/webhook.rb', line 9

def create(url: "#{@base_url}/hooks", data: {})
  make_request(url: url, data: data, method: 'post')
end

#delete(url: "#{@base_url}/hooks/%{hook_id}", hook_id:, data: {}) ⇒ Object



13
14
15
16
# File 'lib/faxplus_api/webhook.rb', line 13

def delete(url: "#{@base_url}/hooks/%{hook_id}", hook_id:, data: {})
  url = url % {hook_id: hook_id}
  make_request(url: url, data: data, method: 'delete')
end

#list(url: "#{@base_url}/hooks", data: {}) ⇒ Object



5
6
7
# File 'lib/faxplus_api/webhook.rb', line 5

def list(url: "#{@base_url}/hooks", data: {})
  make_request(url: url, data: data)
end