Class: SimpleHubspot::Contact
- Inherits:
-
Object
- Object
- SimpleHubspot::Contact
- Defined in:
- lib/simple_hubspot/contact.rb
Class Method Summary collapse
- .create_or_update(email, params) ⇒ Object
- .find_by_email(email) ⇒ Object
- .update(vid, params = {}) ⇒ Object
Class Method Details
.create_or_update(email, params) ⇒ Object
6 7 8 |
# File 'lib/simple_hubspot/contact.rb', line 6 def create_or_update(email, params) ApiClient.do_post "/contacts/v1/contact/createOrUpdate/email/#{email}", { properties: Utils.hash_to_properties(params) } end |
.find_by_email(email) ⇒ Object
10 11 12 |
# File 'lib/simple_hubspot/contact.rb', line 10 def find_by_email(email) ApiClient.do_get "/contacts/v1/contact/email/#{email}/profile" end |
.update(vid, params = {}) ⇒ Object
14 15 16 17 |
# File 'lib/simple_hubspot/contact.rb', line 14 def update(vid, params = {}) raise ArgumentError unless vid ApiClient.do_post "/contacts/v1/contact/vid/#{vid}/profile", { properties: Utils.hash_to_properties(params) } end |