Module: OfficeAutopilotApi::Client::Contacts

Included in:
OfficeAutopilotApi::Client
Defined in:
lib/office_autopilot_api/client/contacts.rb

Constant Summary collapse

CONTACTS_ENDPOINT =
'/cdata.php'

Instance Method Summary collapse

Instance Method Details

#contacts_add(options) ⇒ Object



13
14
15
16
17
# File 'lib/office_autopilot_api/client/contacts.rb', line 13

def contacts_add(options)
  xml = xml_for_contact(options)
  response = request(:post, CONTACTS_ENDPOINT, :body => {'reqType' => 'add', 'return_id' => '1', 'data' => xml})
  parse_contacts_xml(response)[0]
end

#contacts_fetch(ids) ⇒ Object



40
41
42
43
44
# File 'lib/office_autopilot_api/client/contacts.rb', line 40

def contacts_fetch(ids)
  xml = xml_for_fetch("contact", ids)
  response = request(:post, CONTACTS_ENDPOINT, :body => {'reqType' => 'fetch', 'data' => xml})
  parse_contacts_xml(response)
end

#contacts_fetch_sequencesObject



30
31
32
33
# File 'lib/office_autopilot_api/client/contacts.rb', line 30

def contacts_fetch_sequences
  response = request(:post, CONTACTS_ENDPOINT, :body => {'reqType' => 'fetch_sequences'})
  parse_xml(response, "sequence")
end

#contacts_keyObject



35
36
37
38
# File 'lib/office_autopilot_api/client/contacts.rb', line 35

def contacts_key
  response = request(:post, CONTACTS_ENDPOINT, :body => {'reqType' => 'key'})
  parse_contacts_key_xml(response)
end

#contacts_pull_tagObject



25
26
27
28
# File 'lib/office_autopilot_api/client/contacts.rb', line 25

def contacts_pull_tag
  response = request(:post, CONTACTS_ENDPOINT, :body => {'reqType' => 'pull_tag'})
  parse_xml(response, "tag")
end

#contacts_search(options) ⇒ Object



7
8
9
10
11
# File 'lib/office_autopilot_api/client/contacts.rb', line 7

def contacts_search(options)
  xml = xml_for_search(options)
  response = request(:post, CONTACTS_ENDPOINT, :body => {'reqType' => 'search', 'data' => xml})
  parse_contacts_xml(response)
end

#contacts_update(options) ⇒ Object



19
20
21
22
23
# File 'lib/office_autopilot_api/client/contacts.rb', line 19

def contacts_update(options)
  xml = xml_for_contact(options)
  response = request(:post, CONTACTS_ENDPOINT, :body => {'reqType' => 'update', 'return_id' => '1', 'data' => xml})
  parse_contacts_xml(response)[0]
end