Class: MailchimpMarketing::CustomerJourneysApi
- Inherits:
-
Object
- Object
- MailchimpMarketing::CustomerJourneysApi
- Defined in:
- lib/MailchimpMarketing/api/customer_journeys_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client) ⇒ CustomerJourneysApi
constructor
A new instance of CustomerJourneysApi.
-
#trigger(journey_id, step_id, body, opts = {}) ⇒ Object
Customer Journeys API trigger for a contact.
Constructor Details
#initialize(api_client) ⇒ CustomerJourneysApi
Returns a new instance of CustomerJourneysApi.
19 20 21 |
# File 'lib/MailchimpMarketing/api/customer_journeys_api.rb', line 19 def initialize(api_client) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/MailchimpMarketing/api/customer_journeys_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#trigger(journey_id, step_id, body, opts = {}) ⇒ Object
Customer Journeys API trigger for a contact
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/MailchimpMarketing/api/customer_journeys_api.rb', line 24 def trigger(journey_id, step_id, body, opts = {}) fail ArgumentError, "Missing required param: 'journey_id'" if journey_id.nil? fail ArgumentError, "Missing required param: 'step_id'" if step_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/customer-journeys/journeys/{journey_id}/steps/{step_id}/actions/trigger'.sub('{' + 'journey_id' + '}', journey_id.to_s).sub('{' + 'step_id' + '}', step_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end |