Class: RubyApiPackActiveCampaign::Api::AcContacts

Inherits:
Object
  • Object
show all
Extended by:
RubyApiPackCore::Handlers::ResponseValidator
Defined in:
lib/ruby_api_pack_active_campaign/api/ac_contacts.rb

Constant Summary collapse

ENDPOINT =
'/contacts'

Class Method Summary collapse

Class Method Details

.bulk_import_contacts(import_params) ⇒ Object



49
50
51
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 49

def bulk_import_contacts(import_params)
  validate_response(connection(nil, '/import/bulk_import').api_post(import_params), expected_type: :hash)
end

.bulk_import_status_infoObject



57
58
59
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 57

def bulk_import_status_info
  validate_response(connection(nil, '/import/info').api_get, expected_type: :hash)
end

.bulk_import_status_listObject



53
54
55
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 53

def bulk_import_status_list
  validate_response(connection(nil, '/import/bulk_import').api_get, expected_type: :hash)
end

.contact_by_id(contact_id) ⇒ Object



13
14
15
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 13

def contact_by_id(contact_id)
  validate_response(connection(contact_id).api_get, expected_type: :hash)
end

.contact_listObject



17
18
19
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 17

def contact_list
  validate_response(connection.api_get, expected_type: :hash)['contacts']
end

.create_contact(contact_params) ⇒ Object



21
22
23
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 21

def create_contact(contact_params)
  validate_response(connection.api_post(contact_params), expected_type: :hash)
end

.delete_contact(contact_id) ⇒ Object



33
34
35
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 33

def delete_contact(contact_id)
  validate_response(connection(contact_id).api_delete, expected_type: :hash)
end

.list_all_notesObject



111
112
113
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 111

def list_all_notes
  validate_response(connection(nil, '/notes').api_get, expected_type: :hash)
end

.list_automations(contact_id) ⇒ Object



41
42
43
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 41

def list_automations(contact_id)
  validate_response(connection(contact_id, '/contactAutomations').api_get, expected_type: :hash)
end

.list_contact_activitiesObject



61
62
63
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 61

def list_contact_activities
  validate_response(connection(nil, '/activities').api_get, expected_type: :hash)
end

.retrieve_account_contacts(contact_id) ⇒ Object



127
128
129
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 127

def (contact_id)
  validate_response(connection(contact_id, '/accountContacts').api_get, expected_type: :hash)
end

.retrieve_automation_entry_counts(contact_id) ⇒ Object



131
132
133
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 131

def retrieve_automation_entry_counts(contact_id)
  validate_response(connection(contact_id, '/automationEntryCounts').api_get, expected_type: :hash)
end

.retrieve_bounce_logs(contact_id) ⇒ Object



65
66
67
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 65

def retrieve_bounce_logs(contact_id)
  validate_response(connection(contact_id, '/bounceLogs').api_get, expected_type: :hash)
end

.retrieve_contact_data(contact_id) ⇒ Object



69
70
71
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 69

def retrieve_contact_data(contact_id)
  validate_response(connection(contact_id, '/contactData').api_get, expected_type: :hash)
end

.retrieve_contact_deals(contact_id) ⇒ Object



85
86
87
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 85

def retrieve_contact_deals(contact_id)
  validate_response(connection(contact_id, '/deals').api_get, expected_type: :hash)
end

.retrieve_contact_field_values(contact_id) ⇒ Object



89
90
91
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 89

def retrieve_contact_field_values(contact_id)
  validate_response(connection(contact_id, '/fieldValues').api_get, expected_type: :hash)
end

.retrieve_contact_geo_ips(contact_id) ⇒ Object



93
94
95
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 93

def retrieve_contact_geo_ips(contact_id)
  validate_response(connection(contact_id, '/geoIps').api_get, expected_type: :hash)
end

.retrieve_contact_goals(contact_id) ⇒ Object



73
74
75
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 73

def retrieve_contact_goals(contact_id)
  validate_response(connection(contact_id, '/contactGoals').api_get, expected_type: :hash)
end

.retrieve_contact_list_memberships(contact_id) ⇒ Object



77
78
79
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 77

def retrieve_contact_list_memberships(contact_id)
  validate_response(connection(contact_id, '/contactLists').api_get, expected_type: :hash)
end

.retrieve_contact_logs(contact_id) ⇒ Object



81
82
83
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 81

def retrieve_contact_logs(contact_id)
  validate_response(connection(contact_id, '/contactLogs').api_get, expected_type: :hash)
end

.retrieve_contact_notes(contact_id) ⇒ Object



107
108
109
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 107

def retrieve_contact_notes(contact_id)
  validate_response(connection(contact_id, '/notes').api_get, expected_type: :hash)
end

.retrieve_contact_organization(contact_id) ⇒ Object



115
116
117
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 115

def retrieve_contact_organization(contact_id)
  validate_response(connection(contact_id, '/organization').api_get, expected_type: :hash)
end

.retrieve_contact_plus_append(contact_id) ⇒ Object



119
120
121
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 119

def retrieve_contact_plus_append(contact_id)
  validate_response(connection(contact_id, '/plusAppend').api_get, expected_type: :hash)
end

.retrieve_contact_score(contact_id) ⇒ Object



45
46
47
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 45

def retrieve_contact_score(contact_id)
  validate_response(connection(contact_id, '/scoreValues').api_get, expected_type: :hash)
end

.retrieve_geo_ip_address(geo_address_id) ⇒ Object



97
98
99
100
101
102
103
104
105
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 97

def retrieve_geo_ip_address(geo_address_id)
  validate_response(
    Connection::AcConnect.new(
      RubyApiPackActiveCampaign.configuration.ac_api_url,
      "/geoIps/#{geo_address_id}/geoAddress"
    ).api_get,
    expected_type: :hash
  )
end

.retrieve_tracking_logs(contact_id) ⇒ Object



123
124
125
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 123

def retrieve_tracking_logs(contact_id)
  validate_response(connection(contact_id, '/trackingLogs').api_get, expected_type: :hash)
end

.sync_contact(contact_params) ⇒ Object



25
26
27
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 25

def sync_contact(contact_params)
  validate_response(connection(nil, '/contact/sync').api_post(contact_params), expected_type: :hash)
end

.update_contact(contact_id, contact_params) ⇒ Object



29
30
31
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 29

def update_contact(contact_id, contact_params)
  validate_response(connection(contact_id).api_put(contact_params), expected_type: :hash)
end

.update_contact_list_status(contact_list_params) ⇒ Object



37
38
39
# File 'lib/ruby_api_pack_active_campaign/api/ac_contacts.rb', line 37

def update_contact_list_status(contact_list_params)
  validate_response(connection(nil, '/contactLists').api_post(contact_list_params), expected_type: :hash)
end