Class: Emarsys::ContactList
- Inherits:
-
DataObject
- Object
- DataObject
- Emarsys::ContactList
- Defined in:
- lib/emarsys/data_objects/contact_list.rb
Overview
Methods for the ContactList API
Class Method Summary collapse
-
.add_contacts(contact_list_id, key_id, external_ids = []) ⇒ Object
Add a contacts to a specific contact list.
-
.collection ⇒ Hash
List contact lists.
-
.create(params = {}) ⇒ Hash
Internal id of the contact list.
-
.remove_contacts(contact_list_id, key_id, external_ids = []) ⇒ Object
Remove contacts from a specific contact list.
Methods inherited from DataObject
delete, get, parameterize_params, post, put, #request
Class Method Details
.add_contacts(contact_list_id, key_id, external_ids = []) ⇒ Object
Add a contacts to a specific contact list
This cannot be an instance method, because the API does not allow to retrieve a single resource. How crappy is that?
34 35 36 |
# File 'lib/emarsys/data_objects/contact_list.rb', line 34 def add_contacts(contact_list_id, key_id, external_ids = []) post "contactlist/#{contact_list_id}/add", {'key_id' => key_id, 'external_ids' => external_ids} end |
.collection ⇒ Hash
List contact lists
14 15 16 |
# File 'lib/emarsys/data_objects/contact_list.rb', line 14 def collection get 'contactlist', {} end |
.create(params = {}) ⇒ Hash
Returns internal id of the contact list.
27 28 29 |
# File 'lib/emarsys/data_objects/contact_list.rb', line 27 def create(params = {}) post "contactlist", params end |
.remove_contacts(contact_list_id, key_id, external_ids = []) ⇒ Object
Remove contacts from a specific contact list
This cannot be an instance method, because the API does not allow to retrieve a single resource. How crappy is that?
41 42 43 |
# File 'lib/emarsys/data_objects/contact_list.rb', line 41 def remove_contacts(contact_list_id, key_id, external_ids = []) post "contactlist/#{contact_list_id}/remove", {'key_id' => key_id, 'external_ids' => external_ids} end |