module ActiveCampaignCrm::Client::Contacts

Public Instance Methods

contact(id) click to toggle source
# File lib/active_campaign_crm/client/contacts.rb, line 9
def contact(id)
  response = @connection.get("contacts/#{id}")
  response['contact']
end
contact_body(fields) click to toggle source
# File lib/active_campaign_crm/client/contacts.rb, line 33
def contact_body(fields)
  { 'contact': fields }.to_json
end
contacts(params = {}) click to toggle source
# File lib/active_campaign_crm/client/contacts.rb, line 4
def contacts(params = {})
  response = @connection.get('contacts', params)
  response['contacts']
end
create_contact(fields) click to toggle source
# File lib/active_campaign_crm/client/contacts.rb, line 14
def create_contact(fields)
  response = @connection.post('contacts', contact_body(fields))
  response['contact']
end
delete_contact(id) click to toggle source
# File lib/active_campaign_crm/client/contacts.rb, line 29
def delete_contact(id)
  @connection.delete("contacts/#{id}")
end
sync_contact(fields) click to toggle source
# File lib/active_campaign_crm/client/contacts.rb, line 19
def sync_contact(fields)
  response = @connection.post('contact/sync', contact_body(fields))
  response['contact']
end
update_contact(id, fields) click to toggle source
# File lib/active_campaign_crm/client/contacts.rb, line 24
def update_contact(id, fields)
  response = @connection.put("contacts/#{id}", contact_body(fields))
  response['contact']
end