Class: WebinarjamApi::Client
- Inherits:
-
Object
- Object
- WebinarjamApi::Client
- Defined in:
- lib/webinarjam_api.rb
Constant Summary collapse
- API_ENDPOINT =
"https://app.webinarjam.com/api/v2"
Instance Method Summary collapse
- #get_webinar(webinar_id) ⇒ Object
- #get_webinars ⇒ Object
-
#initialize(api_key) ⇒ Client
constructor
A new instance of Client.
- #register_person(webinar_id, schedule, lead) ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Client
Returns a new instance of Client.
8 9 10 |
# File 'lib/webinarjam_api.rb', line 8 def initialize(api_key) @api_key = api_key end |
Instance Method Details
#get_webinar(webinar_id) ⇒ Object
17 18 19 20 |
# File 'lib/webinarjam_api.rb', line 17 def get_webinar(webinar_id) data = { api_key: @api_key, webinar_id: webinar_id } HTTParty.post("#{API_ENDPOINT}/webinar", body: data ) end |
#get_webinars ⇒ Object
12 13 14 15 |
# File 'lib/webinarjam_api.rb', line 12 def get_webinars data = { api_key: @api_key } HTTParty.post("#{API_ENDPOINT}/webinars", body: data ) end |
#register_person(webinar_id, schedule, lead) ⇒ Object
22 23 24 25 26 |
# File 'lib/webinarjam_api.rb', line 22 def register_person(webinar_id, schedule, lead) data = { api_key: @api_key, webinar_id: webinar_id, schedule: schedule } lead_data = data.merge(lead) HTTParty.post("#{API_ENDPOINT}/register", body: lead_data ) end |