Module: Eloqua::Contact

Included in:
RESTClient
Defined in:
lib/eloqua_api/rest/contact.rb

Instance Method Summary collapse

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, options={})
  options[:startDate] ||= 1.year.ago.to_i
  options[:endDate] ||= Time.now.to_i
  options[:type] ||= "webVisit"
  options[:count] ||= 1000

  get("data/activities/contact/%s" % contact_id, options)
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, options={})
  options[:depth] ||= "minimal"
  options[:count] ||= 1
  options[:search] = email
  
  get("data/contacts", options)
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, options={})
  options[:depth] ||= "minimal"
  
  get("data/contact/#{contact_id}", options)
end

#get_contact_fields(options = {}) ⇒ Object



17
18
19
20
21
# File 'lib/eloqua_api/rest/contact.rb', line 17

def get_contact_fields(options={})
  options[:depth] ||= "minimal"

  get("assets/contact/fields", options)
end

#get_contacts(options = {}) ⇒ Object



31
32
33
34
35
36
# File 'lib/eloqua_api/rest/contact.rb', line 31

def get_contacts(options={})
  options[:count] ||= 10
  options[:depth] ||= "minimal"

  get("data/contacts", options)
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