Class: Emarsys::Segment
- Inherits:
-
DataObject
- Object
- DataObject
- Emarsys::Segment
- Defined in:
- lib/emarsys/data_objects/segment.rb
Overview
Methods for the Segment API
Class Method Summary collapse
-
.collection(account: nil) ⇒ Hash
List segments.
-
.run(id, account: nil) ⇒ Object
Run a Segment for Multiple Contacts Reference: dev.emarsys.com/v2/segments/run-a-contact-segment-batch.
-
.status(run_id, account: nil) ⇒ Object
Poll the Status of a Segment Run for Multiple Contacts Reference: dev.emarsys.com/v2/segments/poll-the-status-of-a-segment-run-for-multiple-contacts.
Methods inherited from DataObject
delete, get, parameterize_params, post, put, #request
Class Method Details
.collection(account: nil) ⇒ Hash
List segments
15 16 17 |
# File 'lib/emarsys/data_objects/segment.rb', line 15 def collection(account: nil) get account, 'filter', {} end |
.run(id, account: nil) ⇒ Object
Run a Segment for Multiple Contacts Reference: dev.emarsys.com/v2/segments/run-a-contact-segment-batch
23 24 25 26 |
# File 'lib/emarsys/data_objects/segment.rb', line 23 def run(id, account: nil) path = "filter/#{id}/runs" post account, path, {} end |
.status(run_id, account: nil) ⇒ Object
Poll the Status of a Segment Run for Multiple Contacts Reference: dev.emarsys.com/v2/segments/poll-the-status-of-a-segment-run-for-multiple-contacts
32 33 34 35 |
# File 'lib/emarsys/data_objects/segment.rb', line 32 def status(run_id, account: nil) path = "filter/runs/#{run_id}" get account, path, {} end |