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(id, key_id:, external_ids: [], account: nil) ⇒ Object
Add a contacts to a specific contact list.
-
.collection(account: nil) ⇒ Hash
List contact lists.
-
.create(account: nil, **params) ⇒ Hash
Internal id of the contact list.
-
.remove_contacts(id, key_id:, external_ids: [], account: nil) ⇒ Object
Remove contacts from a specific contact list.
Methods inherited from DataObject
delete, get, parameterize_params, post, put, #request
Class Method Details
.add_contacts(id, key_id:, external_ids: [], account: nil) ⇒ 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?
35 36 37 |
# File 'lib/emarsys/data_objects/contact_list.rb', line 35 def add_contacts(id, key_id:, external_ids: [], account: nil) post account, "contactlist/#{id}/add", {'key_id' => key_id, 'external_ids' => external_ids} end |
.collection(account: nil) ⇒ Hash
List contact lists
15 16 17 |
# File 'lib/emarsys/data_objects/contact_list.rb', line 15 def collection(account: nil) get account, 'contactlist', {} end |
.create(account: nil, **params) ⇒ Hash
Returns internal id of the contact list.
28 29 30 |
# File 'lib/emarsys/data_objects/contact_list.rb', line 28 def create(account: nil, **params) post account, "contactlist", params end |
.remove_contacts(id, key_id:, external_ids: [], account: nil) ⇒ 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?
42 43 44 |
# File 'lib/emarsys/data_objects/contact_list.rb', line 42 def remove_contacts(id, key_id:, external_ids: [], account: nil) post account, "contactlist/#{id}/remove", {'key_id' => key_id, 'external_ids' => external_ids} end |