Class: MailchimpMarketing::CampaignsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/MailchimpMarketing/api/campaigns_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client) ⇒ CampaignsApi

Returns a new instance of CampaignsApi.



19
20
21
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 19

def initialize(api_client)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_feedback(campaign_id = {}, body = {}, opts = {}) ⇒ CampaignFeedback2

Add campaign feedback Add feedback on a specific campaign.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • body (defaults to: {})
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (CampaignFeedback2)


986
987
988
989
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 986

def add_feedback(campaign_id = {}, body = {}, opts = {})
  data, _status_code, _headers = add_feedback_with_http_info(campaign_id, body, opts)
  data
end

#add_feedback_with_http_info(campaign_id, body, opts = {}) ⇒ Array<(CampaignFeedback2, Fixnum, Hash)>

Add campaign feedback Add feedback on a specific campaign.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CampaignFeedback2, Fixnum, Hash)>)

    CampaignFeedback2 data, response status code and response headers



997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 997

def add_feedback_with_http_info(campaign_id, body, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/feedback'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CampaignFeedback2')
  return data, status_code, headers
end

#cancel_send(campaign_id = {}, opts = {}) ⇒ nil

Cancel a campaign Cancel a Regular or Plain-Text Campaign after you send, before all of your recipients receive it. This feature is included with [Mailchimp Pro](mailchimp.com/pro?utm_source=mc-api&utm_medium=docs&utm_campaign=apidocs).

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


592
593
594
595
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 592

def cancel_send(campaign_id = {}, opts = {})
  cancel_send_with_http_info(campaign_id, opts)
  nil
end

#cancel_send_with_http_info(campaign_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Cancel a campaign Cancel a Regular or Plain-Text Campaign after you send, before all of your recipients receive it. This feature is included with [Mailchimp Pro](mailchimp.com/pro?utm_source&#x3D;mc-api&amp;utm_medium&#x3D;docs&amp;utm_campaign&#x3D;apidocs).

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 602

def cancel_send_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/actions/cancel-send'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#create(body = {}, opts = {}) ⇒ Campaign

Create a new campaign Create a new Mailchimp campaign.

Parameters:

  • body (defaults to: {})
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Campaign)


548
549
550
551
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 548

def create(body = {}, opts = {})
  data, _status_code, _headers = create_with_http_info(body, opts)
  data
end

#create_resend(campaign_id = {}, opts = {}) ⇒ Campaign3

Resend a campaign Creates a Resend to Non-Openers version of this campaign. We will also check if this campaign meets the criteria for Resend to Non-Openers campaigns.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Campaign3)


635
636
637
638
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 635

def create_resend(campaign_id = {}, opts = {})
  data, _status_code, _headers = create_resend_with_http_info(campaign_id, opts)
  data
end

#create_resend_with_http_info(campaign_id, opts = {}) ⇒ Array<(Campaign3, Fixnum, Hash)>

Resend a campaign Creates a Resend to Non-Openers version of this campaign. We will also check if this campaign meets the criteria for Resend to Non-Openers campaigns.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Campaign3, Fixnum, Hash)>)

    Campaign3 data, response status code and response headers



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 645

def create_resend_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/actions/create-resend'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Campaign3')
  return data, status_code, headers
end

#create_with_http_info(body, opts = {}) ⇒ Array<(Campaign, Fixnum, Hash)>

Create a new campaign Create a new Mailchimp campaign.

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Campaign, Fixnum, Hash)>)

    Campaign data, response status code and response headers



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 558

def create_with_http_info(body, opts = {})
  # resource path
  local_var_path = '/campaigns'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Campaign')
  return data, status_code, headers
end

#delete_feedback_message(campaign_id = {}, feedback_id = {}, opts = {}) ⇒ nil

Delete a campaign feedback message Remove a specific feedback message for a campaign.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • feedback_id (defaults to: {})

    The unique id for the feedback message.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


71
72
73
74
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 71

def delete_feedback_message(campaign_id = {}, feedback_id = {}, opts = {})
  delete_feedback_message_with_http_info(campaign_id, feedback_id, opts)
  nil
end

#delete_feedback_message_with_http_info(campaign_id, feedback_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a campaign feedback message Remove a specific feedback message for a campaign.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • feedback_id

    The unique id for the feedback message.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 82

def delete_feedback_message_with_http_info(campaign_id, feedback_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/feedback/{feedback_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'feedback_id' + '}', feedback_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#get(campaign_id = {}, opts = {}) ⇒ Campaign

Get information about a specific campaign Get information about a specific campaign.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (Campaign)


204
205
206
207
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 204

def get(campaign_id = {}, opts = {})
  data, _status_code, _headers = get_with_http_info(campaign_id, opts)
  data
end

#get_content(campaign_id = {}, opts = {}) ⇒ CampaignContent

Get campaign content Get the the HTML and plain-text content for a campaign.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (CampaignContent)


254
255
256
257
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 254

def get_content(campaign_id = {}, opts = {})
  data, _status_code, _headers = get_content_with_http_info(campaign_id, opts)
  data
end

#get_content_with_http_info(campaign_id, opts = {}) ⇒ Array<(CampaignContent, Fixnum, Hash)>

Get campaign content Get the the HTML and plain-text content for a campaign.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (Array<(CampaignContent, Fixnum, Hash)>)

    CampaignContent data, response status code and response headers



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 266

def get_content_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/content'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CampaignContent')
  return data, status_code, headers
end

#get_feedback(campaign_id = {}, opts = {}) ⇒ CampaignReports

Get feedback about a campaign Get team feedback while you’re [working together on a Mailchimp campaign](mailchimp.com/help/collaborate-on-campaigns/).

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (CampaignReports)


304
305
306
307
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 304

def get_feedback(campaign_id = {}, opts = {})
  data, _status_code, _headers = get_feedback_with_http_info(campaign_id, opts)
  data
end

#get_feedback_message(campaign_id = {}, feedback_id = {}, opts = {}) ⇒ CampaignFeedback2

Get a specific feedback message Get a specific feedback message from a campaign.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • feedback_id (defaults to: {})

    The unique id for the feedback message.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (CampaignFeedback2)


355
356
357
358
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 355

def get_feedback_message(campaign_id = {}, feedback_id = {}, opts = {})
  data, _status_code, _headers = get_feedback_message_with_http_info(campaign_id, feedback_id, opts)
  data
end

#get_feedback_message_with_http_info(campaign_id, feedback_id, opts = {}) ⇒ Array<(CampaignFeedback2, Fixnum, Hash)>

Get a specific feedback message Get a specific feedback message from a campaign.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • feedback_id

    The unique id for the feedback message.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (Array<(CampaignFeedback2, Fixnum, Hash)>)

    CampaignFeedback2 data, response status code and response headers



368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 368

def get_feedback_message_with_http_info(campaign_id, feedback_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/feedback/{feedback_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'feedback_id' + '}', feedback_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CampaignFeedback2')
  return data, status_code, headers
end

#get_feedback_with_http_info(campaign_id, opts = {}) ⇒ Array<(CampaignReports, Fixnum, Hash)>

Get feedback about a campaign Get team feedback while you&#39;re [working together on a Mailchimp campaign](mailchimp.com/help/collaborate-on-campaigns/).

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (Array<(CampaignReports, Fixnum, Hash)>)

    CampaignReports data, response status code and response headers



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 316

def get_feedback_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/feedback'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CampaignReports')
  return data, status_code, headers
end

#get_send_checklist(campaign_id = {}, opts = {}) ⇒ SendChecklist

Get the send checklist for a campaign Review the send checklist for a campaign, and resolve any issues before sending.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (SendChecklist)


406
407
408
409
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 406

def get_send_checklist(campaign_id = {}, opts = {})
  data, _status_code, _headers = get_send_checklist_with_http_info(campaign_id, opts)
  data
end

#get_send_checklist_with_http_info(campaign_id, opts = {}) ⇒ Array<(SendChecklist, Fixnum, Hash)>

Get the send checklist for a campaign Review the send checklist for a campaign, and resolve any issues before sending.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (Array<(SendChecklist, Fixnum, Hash)>)

    SendChecklist data, response status code and response headers



418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 418

def get_send_checklist_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/send-checklist'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SendChecklist')
  return data, status_code, headers
end

#get_with_http_info(campaign_id, opts = {}) ⇒ Array<(Campaign, Fixnum, Hash)>

Get information about a specific campaign Get information about a specific campaign.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

Returns:

  • (Array<(Campaign, Fixnum, Hash)>)

    Campaign data, response status code and response headers



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 216

def get_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Campaign')
  return data, status_code, headers
end

#list(opts = {}) ⇒ InlineResponse2005

Get all campaigns Get all campaigns in an account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

  • :count (Integer)

    The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 10. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 1000 (default to 10)

  • :offset (Integer)

    The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 0. (default to 0)

  • :type (String)

    The campaign type.

  • :status (String)

    The status of the campaign.

  • :before_send_time (DateTime)

    Restrict the response to campaigns sent before the set time. We recommend [ISO 8601](en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.

  • :since_send_time (DateTime)

    Restrict the response to campaigns sent after the set time. We recommend [ISO 8601](en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.

  • :before_create_time (DateTime)

    Restrict the response to campaigns created before the set time. We recommend [ISO 8601](en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.

  • :since_create_time (DateTime)

    Restrict the response to campaigns created after the set time. We recommend [ISO 8601](en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.

  • :list_id (String)

    The unique id for the list.

  • :folder_id (String)

    The unique folder id.

  • :member_id (String)

    Retrieve campaigns sent to a particular list member. Member ID is The MD5 hash of the lowercase version of the list member’s email address.

  • :sort_field (String)

    Returns files sorted by the specified field.

  • :sort_dir (String)

    Determines the order direction for sorted results.

Returns:

  • (InlineResponse2005)


129
130
131
132
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 129

def list(opts = {})
  data, _status_code, _headers = list_with_http_info(opts)
  data
end

#list_with_http_info(opts = {}) ⇒ Array<(InlineResponse2005, Fixnum, Hash)>

Get all campaigns Get all campaigns in an account.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

  • :exclude_fields (Array<String>)

    A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

  • :count (Integer)

    The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 10. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 1000

  • :offset (Integer)

    The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is 0.

  • :type (String)

    The campaign type.

  • :status (String)

    The status of the campaign.

  • :before_send_time (DateTime)

    Restrict the response to campaigns sent before the set time. We recommend [ISO 8601](en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.

  • :since_send_time (DateTime)

    Restrict the response to campaigns sent after the set time. We recommend [ISO 8601](en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.

  • :before_create_time (DateTime)

    Restrict the response to campaigns created before the set time. We recommend [ISO 8601](en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.

  • :since_create_time (DateTime)

    Restrict the response to campaigns created after the set time. We recommend [ISO 8601](en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00.

  • :list_id (String)

    The unique id for the list.

  • :folder_id (String)

    The unique folder id.

  • :member_id (String)

    Retrieve campaigns sent to a particular list member. Member ID is The MD5 hash of the lowercase version of the list member’s email address.

  • :sort_field (String)

    Returns files sorted by the specified field.

  • :sort_dir (String)

    Determines the order direction for sorted results.

Returns:

  • (Array<(InlineResponse2005, Fixnum, Hash)>)

    InlineResponse2005 data, response status code and response headers



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 153

def list_with_http_info(opts = {})
  # resource path
  local_var_path = '/campaigns'

  # query parameters
  query_params = {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'before_send_time'] = opts[:'before_send_time'] if !opts[:'before_send_time'].nil?
  query_params[:'since_send_time'] = opts[:'since_send_time'] if !opts[:'since_send_time'].nil?
  query_params[:'before_create_time'] = opts[:'before_create_time'] if !opts[:'before_create_time'].nil?
  query_params[:'since_create_time'] = opts[:'since_create_time'] if !opts[:'since_create_time'].nil?
  query_params[:'list_id'] = opts[:'list_id'] if !opts[:'list_id'].nil?
  query_params[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
  query_params[:'member_id'] = opts[:'member_id'] if !opts[:'member_id'].nil?
  query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil?
  query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2005')
  return data, status_code, headers
end

#pause(campaign_id = {}, opts = {}) ⇒ nil

Pause an RSS-Driven campaign [Pause an RSS-Driven campaign](mailchimp.com/help/pause-or-reactivate-an-rss-campaign/).

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


679
680
681
682
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 679

def pause(campaign_id = {}, opts = {})
  pause_with_http_info(campaign_id, opts)
  nil
end

#pause_with_http_info(campaign_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Pause an RSS-Driven campaign [Pause an RSS-Driven campaign](mailchimp.com/help/pause-or-reactivate-an-rss-campaign/).

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 689

def pause_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/actions/pause'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#remove(campaign_id = {}, opts = {}) ⇒ nil

Delete a campaign Remove a campaign from your Mailchimp account.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 27

def remove(campaign_id = {}, opts = {})
  remove_with_http_info(campaign_id, opts)
  nil
end

#remove_with_http_info(campaign_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a campaign Remove a campaign from your Mailchimp account.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 37

def remove_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#replicate(campaign_id = {}, opts = {}) ⇒ Campaign3

Replicate a campaign [Replicate a campaign](mailchimp.com/help/replicate-a-campaign/) in saved or send status.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Campaign3)


722
723
724
725
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 722

def replicate(campaign_id = {}, opts = {})
  data, _status_code, _headers = replicate_with_http_info(campaign_id, opts)
  data
end

#replicate_with_http_info(campaign_id, opts = {}) ⇒ Array<(Campaign3, Fixnum, Hash)>

Replicate a campaign [Replicate a campaign](mailchimp.com/help/replicate-a-campaign/) in saved or send status.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Campaign3, Fixnum, Hash)>)

    Campaign3 data, response status code and response headers



732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 732

def replicate_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/actions/replicate'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Campaign3')
  return data, status_code, headers
end

#resume(campaign_id = {}, opts = {}) ⇒ nil

Resume an RSS-Driven campaign [Resume an RSS-Driven campaign](mailchimp.com/help/pause-or-reactivate-an-rss-campaign/).

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


766
767
768
769
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 766

def resume(campaign_id = {}, opts = {})
  resume_with_http_info(campaign_id, opts)
  nil
end

#resume_with_http_info(campaign_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Resume an RSS-Driven campaign [Resume an RSS-Driven campaign](mailchimp.com/help/pause-or-reactivate-an-rss-campaign/).

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 776

def resume_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/actions/resume'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#schedule(campaign_id = {}, body = {}, opts = {}) ⇒ nil

Schedule a campaign [Schedule a campaign](mailchimp.com/help/schedule-or-pause-a-regular-email-campaign/) for delivery. If you’re using [Multivariate Campaigns](mailchimp.com/help/about-multivariate-campaigns/) to test send times or sending [RSS Campaigns](mailchimp.com/help/share-your-blog-posts-with-mailchimp/), use the [send](/developer/reference/campaigns/#action-post_campaigns_campaign_id_actions_send) action instead.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • body (defaults to: {})
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


810
811
812
813
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 810

def schedule(campaign_id = {}, body = {}, opts = {})
  schedule_with_http_info(campaign_id, body, opts)
  nil
end

#schedule_with_http_info(campaign_id, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Schedule a campaign [Schedule a campaign](mailchimp.com/help/schedule-or-pause-a-regular-email-campaign/) for delivery. If you&#39;re using [Multivariate Campaigns](mailchimp.com/help/about-multivariate-campaigns/) to test send times or sending [RSS Campaigns](mailchimp.com/help/share-your-blog-posts-with-mailchimp/), use the [send](/developer/reference/campaigns/#action-post_campaigns_campaign_id_actions_send) action instead.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 821

def schedule_with_http_info(campaign_id, body, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/actions/schedule'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#send(campaign_id = {}, opts = {}) ⇒ nil

Send a campaign Send a Mailchimp campaign. For [RSS Campaigns](mailchimp.com/help/share-your-blog-posts-with-mailchimp/), the campaign will send according to its schedule. All other campaigns will send immediately.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


854
855
856
857
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 854

def send(campaign_id = {}, opts = {})
  send_with_http_info(campaign_id, opts)
  nil
end

#send_test_email(campaign_id = {}, body = {}, opts = {}) ⇒ nil

Send a test email Send a [test email](mailchimp.com/help/preview-and-test-your-email-campaign/).

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • body (defaults to: {})
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


898
899
900
901
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 898

def send_test_email(campaign_id = {}, body = {}, opts = {})
  send_test_email_with_http_info(campaign_id, body, opts)
  nil
end

#send_test_email_with_http_info(campaign_id, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Send a test email Send a [test email](mailchimp.com/help/preview-and-test-your-email-campaign/).

Parameters:

  • campaign_id

    The unique id for the campaign.

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 909

def send_test_email_with_http_info(campaign_id, body, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/actions/test'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#send_with_http_info(campaign_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Send a campaign Send a Mailchimp campaign. For [RSS Campaigns](mailchimp.com/help/share-your-blog-posts-with-mailchimp/), the campaign will send according to its schedule. All other campaigns will send immediately.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 864

def send_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/actions/send'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#set_content(campaign_id = {}, body = {}, opts = {}) ⇒ CampaignContent

Set campaign content Set the content for a campaign.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • body (defaults to: {})
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (CampaignContent)


1032
1033
1034
1035
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 1032

def set_content(campaign_id = {}, body = {}, opts = {})
  data, _status_code, _headers = set_content_with_http_info(campaign_id, body, opts)
  data
end

#set_content_with_http_info(campaign_id, body, opts = {}) ⇒ Array<(CampaignContent, Fixnum, Hash)>

Set campaign content Set the content for a campaign.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CampaignContent, Fixnum, Hash)>)

    CampaignContent data, response status code and response headers



1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 1043

def set_content_with_http_info(campaign_id, body, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/content'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CampaignContent')
  return data, status_code, headers
end

#unschedule(campaign_id = {}, opts = {}) ⇒ nil

Unschedule a campaign [Unschedule](mailchimp.com/help/schedule-or-pause-a-regular-email-campaign/) a scheduled campaign that hasn’t started sending.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


942
943
944
945
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 942

def unschedule(campaign_id = {}, opts = {})
  unschedule_with_http_info(campaign_id, opts)
  nil
end

#unschedule_with_http_info(campaign_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Unschedule a campaign [Unschedule](mailchimp.com/help/schedule-or-pause-a-regular-email-campaign/) a scheduled campaign that hasn&#39;t started sending.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 952

def unschedule_with_http_info(campaign_id, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/actions/unschedule'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  return data, status_code, headers
end

#update(campaign_id = {}, body = {}, opts = {}) ⇒ Campaign

Update the settings for a campaign Update some or all of the settings for a specific campaign.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • body (defaults to: {})
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Campaign)


455
456
457
458
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 455

def update(campaign_id = {}, body = {}, opts = {})
  data, _status_code, _headers = update_with_http_info(campaign_id, body, opts)
  data
end

#update_feedback_message(campaign_id = {}, feedback_id = {}, body = {}, opts = {}) ⇒ CampaignFeedback2

Update a campaign feedback message Update a specific feedback message for a campaign.

Parameters:

  • campaign_id (defaults to: {})

    The unique id for the campaign.

  • feedback_id (defaults to: {})

    The unique id for the feedback message.

  • body (defaults to: {})
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (CampaignFeedback2)


502
503
504
505
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 502

def update_feedback_message(campaign_id = {}, feedback_id = {}, body = {}, opts = {})
  data, _status_code, _headers = update_feedback_message_with_http_info(campaign_id, feedback_id, body, opts)
  data
end

#update_feedback_message_with_http_info(campaign_id, feedback_id, body, opts = {}) ⇒ Array<(CampaignFeedback2, Fixnum, Hash)>

Update a campaign feedback message Update a specific feedback message for a campaign.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • feedback_id

    The unique id for the feedback message.

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CampaignFeedback2, Fixnum, Hash)>)

    CampaignFeedback2 data, response status code and response headers



514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 514

def update_feedback_message_with_http_info(campaign_id, feedback_id, body, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}/feedback/{feedback_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'feedback_id' + '}', feedback_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CampaignFeedback2')
  return data, status_code, headers
end

#update_with_http_info(campaign_id, body, opts = {}) ⇒ Array<(Campaign, Fixnum, Hash)>

Update the settings for a campaign Update some or all of the settings for a specific campaign.

Parameters:

  • campaign_id

    The unique id for the campaign.

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Campaign, Fixnum, Hash)>)

    Campaign data, response status code and response headers



466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
# File 'lib/MailchimpMarketing/api/campaigns_api.rb', line 466

def update_with_http_info(campaign_id, body, opts = {})
  # resource path
  local_var_path = '/campaigns/{campaign_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Campaign')
  return data, status_code, headers
end