Module: Eloqua::Contact
- Included in:
- RESTClient
- Defined in:
- lib/eloqua_api/rest/contact.rb
Instance Method Summary collapse
- #contact_activity(contact_id, options = {}) ⇒ Object
- #create_contact(data) ⇒ Object
- #find_contact_by_email(email, options = {}) ⇒ Object
- #get_contact(contact_id, options = {}) ⇒ Object
- #get_contact_fields(options = {}) ⇒ Object
- #get_contacts(options = {}) ⇒ Object
- #update_contact(contact_id, data) ⇒ Object
Instance Method Details
#contact_activity(contact_id, options = {}) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/eloqua_api/rest/contact.rb', line 38 def contact_activity(contact_id, ={}) [:startDate] ||= 1.year.ago.to_i [:endDate] ||= Time.now.to_i [:type] ||= "webVisit" [:count] ||= 1000 get("data/activities/contact/%s" % contact_id, ) end |
#create_contact(data) ⇒ Object
23 24 25 |
# File 'lib/eloqua_api/rest/contact.rb', line 23 def create_contact(data) post("data/contact", data) end |
#find_contact_by_email(email, options = {}) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/eloqua_api/rest/contact.rb', line 3 def find_contact_by_email(email, ={}) [:depth] ||= "minimal" [:count] ||= 1 [:search] = email get("data/contacts", ) end |
#get_contact(contact_id, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/eloqua_api/rest/contact.rb', line 11 def get_contact(contact_id, ={}) [:depth] ||= "minimal" get("data/contact/#{contact_id}", ) end |
#get_contact_fields(options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/eloqua_api/rest/contact.rb', line 17 def get_contact_fields(={}) [:depth] ||= "minimal" get("assets/contact/fields", ) end |
#get_contacts(options = {}) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/eloqua_api/rest/contact.rb', line 31 def get_contacts(={}) [:count] ||= 10 [:depth] ||= "minimal" get("data/contacts", ) end |
#update_contact(contact_id, data) ⇒ Object
27 28 29 |
# File 'lib/eloqua_api/rest/contact.rb', line 27 def update_contact(contact_id, data) put("data/contact/#{contact_id}", data) end |