Module: Frontapp::Client::ContactGroups

Included in:
Frontapp::Client
Defined in:
lib/frontapp/client/contact_groups.rb

Instance Method Summary collapse

Instance Method Details

#add_contacts_to_contact_group!(group_id, params = {}) ⇒ Object

Parameters Name Type Description


group_id string Id of the requested group


Allowed attributes: Name Type Description


contact_ids array List of ids or aliases of the contacts to add in the requested group




49
50
51
52
# File 'lib/frontapp/client/contact_groups.rb', line 49

def add_contacts_to_contact_group!(group_id, params = {})
  cleaned = params.permit(:contact_ids)
  create_without_response("contact_groups/#{group_id}/contacts", cleaned)
end

#contact_groups(params = {}) ⇒ Object



5
6
7
# File 'lib/frontapp/client/contact_groups.rb', line 5

def contact_groups(params = {})
  list("contact_groups", params)
end

#create_contact_group!(params = {}) ⇒ Object

Allowed attributes: Name Type Description


name string Name of the group




14
15
16
17
# File 'lib/frontapp/client/contact_groups.rb', line 14

def create_contact_group!(params = {})
  cleaned = params.permit(:name)
  create("contact_groups", cleaned)
end

#delete_contact_group!(group_id) ⇒ Object

Parameters Name Type Description


group_id string Id of the requested group




24
25
26
# File 'lib/frontapp/client/contact_groups.rb', line 24

def delete_contact_group!(group_id)
  delete("contact_groups/#{group_id}")
end

#get_contact_group_contacts(group_id) ⇒ Object

Parameters Name Type Description


group_id string Id of the requested group




34
35
36
# File 'lib/frontapp/client/contact_groups.rb', line 34

def get_contact_group_contacts(group_id)
  get("contact_groups/#{group_id}/contacts")
end