Class: ConstantContact::Api

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key = nil, access_token = nil) ⇒ Object

Class constructor

Parameters:

  • api_key (String) (defaults to: nil)
    • Constant Contact API Key

  • access_token (String) (defaults to: nil)
    • Constant Contact OAuth2 access token



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/constantcontact/api.rb', line 16

def initialize(api_key = nil, access_token = nil)
  @api_key = api_key || Util::Config.get('auth.api_key')
  @access_token = access_token
  if @api_key.nil? || @api_key == ''
    raise ArgumentError.new(Util::Config.get('errors.api_key_missing'))
  end
  if @access_token.nil? || @access_token == ''
    raise ArgumentError.new(Util::Config.get('errors.access_token_missing'))
  end
  
  @account_service = Services::AccountService.new(self)
  @activity_service = Services::ActivityService.new(self)
  @campaign_tracking_service = Services::CampaignTrackingService.new(self)
  @campaign_schedule_service = Services::CampaignScheduleService.new(self)
  @contact_service = Services::ContactService.new(self)
  @contact_tracking_service = Services::ContactTrackingService.new(self)
  @email_marketing_service = Services::EmailMarketingService.new(self)
  @event_spot_service = Services::EventSpotService.new(self)
  @library_service = Services::LibraryService.new(self)
  @list_service = Services::ListService.new(self)
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token



10
11
12
# File 'lib/constantcontact/api.rb', line 10

def access_token
  @access_token
end

#api_keyObject

Returns the value of attribute api_key



10
11
12
# File 'lib/constantcontact/api.rb', line 10

def api_key
  @api_key
end

Instance Method Details

#add_clear_lists_activity(lists) ⇒ Activity

Add a ClearLists Activity to remove all contacts from the provided lists

Parameters:

  • lists (Array<Lists>)
    • Add Contacts Activity

Returns:

  • (Activity)


532
533
534
# File 'lib/constantcontact/api.rb', line 532

def add_clear_lists_activity(lists)
  @activity_service.add_clear_lists_activity(lists)
end

#add_contact(contact, action_by_visitor = false) ⇒ Contact

Add a new contact to an account

Parameters:

  • contact (Contact)
    • Contact to add

  • action_by_visitor (Boolean) (defaults to: false)
    • if the action is being taken by the visitor

Returns:

  • (Contact)


90
91
92
93
94
# File 'lib/constantcontact/api.rb', line 90

def add_contact(contact, action_by_visitor = false)
  params = {}
  params['action_by'] = 'ACTION_BY_VISITOR' if action_by_visitor
  @contact_service.add_contact(contact, params)
end

#add_create_contacts_activity(add_contacts) ⇒ Activity

Add an AddContacts activity to add contacts in bulk

Parameters:

  • add_contacts (AddContacts)
    • Add Contacts Activity

Returns:

  • (Activity)


514
515
516
# File 'lib/constantcontact/api.rb', line 514

def add_create_contacts_activity(add_contacts)
  @activity_service.create_add_contacts_activity(add_contacts)
end

#add_create_contacts_activity_from_file(file_name, contents, lists) ⇒ Activity

Create an Add Contacts Activity from a file. Valid file types are txt, csv, xls, xlsx

Parameters:

  • file_name (String)
    • The name of the file (ie: contacts.csv)

  • contents (String)
    • The content of the file

  • lists (String)
    • Comma separated list of ContactList id's to add the contacts to

Returns:

  • (Activity)


524
525
526
# File 'lib/constantcontact/api.rb', line 524

def add_create_contacts_activity_from_file(file_name, contents, lists)
  @activity_service.create_add_contacts_activity_from_file(file_name, contents, lists)
end

#add_email_campaign(campaign) ⇒ Campaign

Create a new campaign

Parameters:

  • campaign (Campaign)
    • Campaign to be created

Returns:

  • (Campaign)
    • created campaign



229
230
231
# File 'lib/constantcontact/api.rb', line 229

def add_email_campaign(campaign)
  @email_marketing_service.add_campaign(campaign)
end

#add_email_campaign_schedule(campaign, schedule) ⇒ Campaign

Schedule a campaign to be sent

Parameters:

  • campaign (Mixed)
    • Id of a campaign or a Campaign object

  • schedule (Schedule)
    • Schedule to be associated with the provided campaign

Returns:

  • (Campaign)
    • updated campaign



246
247
248
249
# File 'lib/constantcontact/api.rb', line 246

def add_email_campaign_schedule(campaign, schedule)
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_schedule_service.add_schedule(campaign_id, schedule)
end

#add_event(event) ⇒ Event

Create an event

Parameters:

  • event (Hash)
    • Event data stored in an object which respods to to_json

Returns:

  • (Event)


582
583
584
# File 'lib/constantcontact/api.rb', line 582

def add_event(event)
  @event_spot_service.add_event(event)
end

#add_event_fee(event, fee) ⇒ EventFee

Create an event fee

Parameters:

  • event (Event)
    • Event fee corresponds to

  • fee (Hash)
    • Fee details

Returns:

  • (EventFee)


632
633
634
# File 'lib/constantcontact/api.rb', line 632

def add_event_fee(event, fee)
  @event_spot_service.add_fee(event, fee)
end

#add_event_item(event_id, event_item) ⇒ EventItem

Create a new event item for an event

Parameters:

  • event_id (Integer)
    • id of event to be associated with the event item

  • event_item (EventItem)
    • event item to be created

Returns:

  • (EventItem)


693
694
695
# File 'lib/constantcontact/api.rb', line 693

def add_event_item(event_id, event_item)
  @event_spot_service.add_event_item(event_id, event_item)
end

#add_event_item_attribute(event_id, item_id, event_item_attribute) ⇒ EventItemAttribute

Create a new event item attribute for an event item

Parameters:

  • event_id (Integer)
    • id of event to be associated with the event item attribute

  • item_id (Integer)
    • id of event item to be associated with the event item attribute

  • event_item_attribute (EventItemAttribute)
    • event item attribute to be created

Returns:

  • (EventItemAttribute)


740
741
742
# File 'lib/constantcontact/api.rb', line 740

def add_event_item_attribute(event_id, item_id, event_item_attribute)
  @event_spot_service.add_event_item_attribute(event_id, item_id, event_item_attribute)
end

#add_export_contacts_activity(export_contacts) ⇒ Activity

Create an Export Contacts Activity

Parameters:

  • export_contacts (<Array>Contacts)
    • Contacts to be exported

Returns:

  • (Activity)


559
560
561
# File 'lib/constantcontact/api.rb', line 559

def add_export_contacts_activity(export_contacts)
  @activity_service.add_export_contacts_activity(export_contacts)
end

#add_library_file(file_name, folder_id, description, source, file_type, contents) ⇒ LibraryFile

Adds a new MyLibrary file using the multipart content-type

Parameters:

  • file_name (String)
    • The name of the file (ie: dinnerplate-special.jpg)

  • folder_id (String)
    • Folder id to add the file to

  • description (String)
    • The description of the file provided by user

  • source (String)
    • indicates the source of the original file;

    image files can be uploaded from the following sources : MyComputer, StockImage, Facebook - MyLibrary Plus customers only, Instagram - MyLibrary Plus customers only, Shutterstock, Mobile

  • file_type (String)
    • Specifies the file type, valid values are: JPEG, JPG, GIF, PDF, PNG

  • contents (String)
    • The content of the file

Returns:

  • (LibraryFile)


943
944
945
# File 'lib/constantcontact/api.rb', line 943

def add_library_file(file_name, folder_id, description, source, file_type, contents)
  @library_service.add_library_file(file_name, folder_id, description, source, file_type, contents)
end

#add_library_folder(folder) ⇒ LibraryFolder

Create a new MyLibrary folder

Parameters:

  • folder (LibraryFolder)
    • Library Folder to be created

Returns:

  • (LibraryFolder)


836
837
838
# File 'lib/constantcontact/api.rb', line 836

def add_library_folder(folder)
  @library_service.add_library_folder(folder)
end

#add_list(list) ⇒ ContactList

Add a new list to an account

Parameters:

  • list (ContactList)
    • List to add

Returns:

  • (ContactList)


161
162
163
# File 'lib/constantcontact/api.rb', line 161

def add_list(list)
  @list_service.add_list(list)
end

#add_promocode(event_id, promocode) ⇒ Promocode

Create a new promocode for an event

Parameters:

  • event_id (Integer)
    • id of event to be associated with the promocode

  • promocode (Promocode)
    • promocode to be created

Returns:

  • (Promocode)


786
787
788
# File 'lib/constantcontact/api.rb', line 786

def add_promocode(event_id, promocode)
  @event_spot_service.add_promocode(event_id, promocode)
end

#add_remove_contacts_from_lists_activity(email_addresses, lists) ⇒ Activity

Add a Remove Contacts From Lists Activity

Parameters:

  • email_addresses (Array<EmailAddress>)
    • email addresses to be removed

  • lists (Array<Lists>)
    • lists to remove the provided email addresses from

Returns:

  • (Activity)


541
542
543
# File 'lib/constantcontact/api.rb', line 541

def add_remove_contacts_from_lists_activity(email_addresses, lists)
  @activity_service.add_remove_contacts_from_lists_activity(email_addresses, lists)
end

#add_remove_contacts_from_lists_activity_from_file(file_name, contents, lists) ⇒ Activity

Add a Remove Contacts From Lists Activity from a file. Valid file types are txt, csv, xls, xlsx

Parameters:

  • file_name (String)
    • The name of the file (ie: contacts.csv)

  • contents (String)
    • The content of the file

  • lists (String)
    • Comma separated list of ContactList id' to add the contacts too

Returns:

  • (Activity)


551
552
553
# File 'lib/constantcontact/api.rb', line 551

def add_remove_contacts_from_lists_activity_from_file(file_name, contents, lists)
  @activity_service.add_remove_contacts_from_lists_activity_from_file(file_name, contents, lists)
end

#cancel_event(event) ⇒ Event

Cancel an event

Parameters:

  • event (Event)
    • Event to cancel

Returns:

  • (Event)


606
607
608
# File 'lib/constantcontact/api.rb', line 606

def cancel_event(event)
  @event_spot_service.cancel_event(event)
end

#delete_contact(contact) ⇒ Boolean

Sets an individual contact to 'REMOVED' status

Parameters:

  • contact (Mixed)
    • Either a Contact id or the Contact itself

Returns:

  • (Boolean)

Raises:

  • (IllegalArgumentException)

    If contact is not an integer or a Contact object



101
102
103
104
# File 'lib/constantcontact/api.rb', line 101

def delete_contact(contact)
  contact_id = to_id(contact, 'Contact')
  @contact_service.delete_contact(contact_id)
end

#delete_contact_from_list(contact, list) ⇒ Boolean

Delete a contact from all contact lists

Parameters:

  • contact (Mixed)
    • Contact id or a Contact object

  • list (Mixed)
    • ContactList id or a ContactList object

Returns:

  • (Boolean)

Raises:

  • (IllegalArgumentException)

    If contact is not an integer or a Contact object



122
123
124
125
126
# File 'lib/constantcontact/api.rb', line 122

def delete_contact_from_list(contact, list)
  contact_id = to_id(contact, 'Contact')
  list_id = to_id(list, 'ContactList')
  @contact_service.delete_contact_from_list(contact_id, list_id)
end

#delete_contact_from_lists(contact) ⇒ Boolean

Delete a contact from all contact lists

Parameters:

  • contact (Mixed)
    • Contact id or the Contact object itself

Returns:

  • (Boolean)

Raises:

  • (IllegalArgumentException)

    If contact is not an integer or a Contact object



111
112
113
114
# File 'lib/constantcontact/api.rb', line 111

def delete_contact_from_lists(contact)
  contact_id = to_id(contact, 'Contact')
  @contact_service.delete_contact_from_lists(contact_id)
end

#delete_email_campaign(campaign) ⇒ Boolean

Delete an individual campaign

Parameters:

  • campaign (Mixed)
    • Id of a campaign or a Campaign object

Returns:

  • (Boolean)

Raises:

  • IllegalArgumentException - if a Campaign object or campaign id is not passed



220
221
222
223
# File 'lib/constantcontact/api.rb', line 220

def delete_email_campaign(campaign)
  campaign_id = to_id(campaign, 'Campaign')
  @email_marketing_service.delete_campaign(campaign_id)
end

#delete_email_campaign_schedule(campaign, schedule) ⇒ Boolean

Delete a specific schedule associated with a given campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • schedule (Mixed)
    • Schedule id or Schedule object itself

Returns:

  • (Boolean)

Raises:

  • IllegalArgumentException



288
289
290
291
292
# File 'lib/constantcontact/api.rb', line 288

def delete_email_campaign_schedule(campaign, schedule)
  campaign_id = to_id(campaign, 'Campaign')
  schedule_id = to_id(schedule, 'Schedule')
  @campaign_schedule_service.delete_schedule(campaign_id, schedule_id)
end

#delete_event_fee(event, fee) ⇒ Boolean

Delete an event fee

Parameters:

  • event (Event)
    • Event fee corresponds to

  • fee (EventFee)
    • Fee details

Returns:

  • (Boolean)


650
651
652
# File 'lib/constantcontact/api.rb', line 650

def delete_event_fee(event, fee)
  @event_spot_service.delete_fee(event, fee)
end

#delete_event_item(event_id, item_id) ⇒ Boolean

Delete a specific event item for an event

Parameters:

  • event_id (Integer)
    • id of event to delete an event item for

  • item_id (Integer)
    • id of event item to be deleted

Returns:

  • (Boolean)


702
703
704
# File 'lib/constantcontact/api.rb', line 702

def delete_event_item(event_id, item_id)
  @event_spot_service.delete_event_item(event_id, item_id)
end

#delete_event_item_attribute(event_id, item_id, attribute_id) ⇒ Boolean

Delete a specific event item for an event

Parameters:

  • event_id (Integer)
    • id of event to delete an event item attribute for

  • item_id (Integer)
    • id of event item to delete an event item attribute for

  • attribute_id (Integer)
    • id of attribute to be deleted

Returns:

  • (Boolean)


750
751
752
# File 'lib/constantcontact/api.rb', line 750

def delete_event_item_attribute(event_id, item_id, attribute_id)
  @event_spot_service.delete_event_item_attribute(event_id, item_id, attribute_id)
end

#delete_library_file(file_id) ⇒ Boolean

Delete one or more MyLibrary files specified by the fileId path parameter; separate multiple file IDs with a comma. Deleted files are moved from their current folder into the system Trash folder, and its status is set to Deleted.

Parameters:

  • file_id (String)
    • Specifies the MyLibrary file to delete

Returns:

  • (Boolean)


961
962
963
# File 'lib/constantcontact/api.rb', line 961

def delete_library_file(file_id)
  @library_service.delete_library_file(file_id)
end

#delete_library_folder(folder_id) ⇒ Boolean

Delete a MyLibrary folder

Parameters:

  • folder_id (String)
    • The ID for the MyLibrary folder to delete

Returns:

  • (Boolean)


860
861
862
# File 'lib/constantcontact/api.rb', line 860

def delete_library_folder(folder_id)
  @library_service.delete_library_folder(folder_id)
end

#delete_library_trashBoolean

Permanently deletes all files in the Trash folder

Returns:

  • (Boolean)


889
890
891
# File 'lib/constantcontact/api.rb', line 889

def delete_library_trash()
  @library_service.delete_library_trash()
end

#delete_promocode(event_id, promocode_id) ⇒ Boolean

Delete a specific promocode for an event

Parameters:

  • event_id (Integer)
    • id of event to delete a promocode for

  • promocode_id (Integer)
    • id of promocode to be deleted

Returns:

  • (Boolean)


795
796
797
# File 'lib/constantcontact/api.rb', line 795

def delete_promocode(event_id, promocode_id)
  @event_spot_service.delete_promocode(event_id, promocode_id)
end

#get_account_infoAccountInfo

Get a summary of account information

Returns:

  • (AccountInfo)


41
42
43
# File 'lib/constantcontact/api.rb', line 41

def ()
  @account_service.()
end

#get_activities(params = {}) ⇒ Array<Activity>

Get an array of activities

Parameters:

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: status - Status of the activity, must be one of UNCONFIRMED, PENDING, QUEUED, RUNNING, COMPLETE, ERROR type - Type of activity, must be one of ADD_CONTACTS, REMOVE_CONTACTS_FROM_LISTS, CLEAR_CONTACTS_FROM_LISTS,

    EXPORT_CONTACTS
    

Returns:

  • (Array<Activity>)


498
499
500
# File 'lib/constantcontact/api.rb', line 498

def get_activities(params = {})
  @activity_service.get_activities(params)
end

#get_activity(activity_id) ⇒ Activity

Get a single activity by id

Parameters:

  • activity_id (String)
    • Activity id

Returns:

  • (Activity)


506
507
508
# File 'lib/constantcontact/api.rb', line 506

def get_activity(activity_id)
  @activity_service.get_activity(activity_id)
end

#get_contact(contact_id) ⇒ Contact

Get an individual contact

Parameters:

  • contact_id (Integer)
    • Id of the contact to retrieve

Returns:

  • (Contact)


73
74
75
# File 'lib/constantcontact/api.rb', line 73

def get_contact(contact_id)
  @contact_service.get_contact(contact_id)
end

#get_contact_bounces(contact, params = {}) ⇒ ResultSet<BounceActivity>

Get bounces for a Contact

Parameters:

  • contact (Mixed)
    • Contact id or Contact object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<BounceActivity>)


420
421
422
423
# File 'lib/constantcontact/api.rb', line 420

def get_contact_bounces(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  @contact_tracking_service.get_bounces(contact_id, params)
end

#get_contact_by_email(email) ⇒ ResultSet<Contact>

Get contacts with a specified email eaddress

Parameters:

  • email (String)
    • contact email address to search for

Returns:

  • (ResultSet<Contact>)

    a ResultSet of Contacts



81
82
83
# File 'lib/constantcontact/api.rb', line 81

def get_contact_by_email(email)
  @contact_service.get_contacts({'email' => email})
end

#get_contact_clicks(contact, params = {}) ⇒ ResultSet<ClickActivity>

Get clicks for a Contact

Parameters:

  • contact (Mixed)
    • Contact id or Contact object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<ClickActivity>)


434
435
436
437
# File 'lib/constantcontact/api.rb', line 434

def get_contact_clicks(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  @contact_tracking_service.get_clicks(contact_id, params)
end

#get_contact_forwards(contact, params = {}) ⇒ ResultSet<ForwardActivity>

Get forwards for a Contact

Parameters:

  • contact (Mixed)
    • Contact id or Contact object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<ForwardActivity>)


462
463
464
465
# File 'lib/constantcontact/api.rb', line 462

def get_contact_forwards(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  @contact_tracking_service.get_forwards(contact_id, params)
end

#get_contact_opens(contact, params = {}) ⇒ ResultSet<OpenActivity>

Get opens for a Contact

Parameters:

  • contact (Mixed)
    • Contact id or Contact object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<OpenActivity>)


448
449
450
451
# File 'lib/constantcontact/api.rb', line 448

def get_contact_opens(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  @contact_tracking_service.get_opens(contact_id, params)
end

#get_contact_sends(contact, params = {}) ⇒ ResultSet<SendActivity>

Get sends for a Contact

Parameters:

  • contact (Mixed)
    • Contact id or Contact object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<SendActivity>)


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

def get_contact_sends(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  @contact_tracking_service.get_sends(contact_id, params)
end

#get_contact_summary_report(contact) ⇒ TrackingSummary

Get a reporting summary for a Contact

Parameters:

  • contact (Mixed)
    • Contact id or Contact object itself

Returns:

  • (TrackingSummary)


485
486
487
488
# File 'lib/constantcontact/api.rb', line 485

def get_contact_summary_report(contact)
  contact_id = to_id(contact, 'Contact')
  @contact_tracking_service.get_summary(contact_id)
end

#get_contact_unsubscribes(contact, params = {}) ⇒ UnsubscribeActivity

Get unsubscribes for a Contact

Parameters:

  • contact (Mixed)
    • Contact id or Contact object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (UnsubscribeActivity)
    • Containing a results array of UnsubscribeActivity



476
477
478
479
# File 'lib/constantcontact/api.rb', line 476

def get_contact_unsubscribes(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  @contact_tracking_service.get_unsubscribes(contact_id, params)
end

#get_contacts(params = {}) ⇒ ResultSet<Contact>

Get a set of contacts Allowed parameters include:

limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50.
modified_since - ISO-8601 formatted timestamp.
next - the next link returned from a previous paginated call. May only be used by itself.
email - the contact by email address to retrieve information for.
status - a contact status to filter results by. Must be one of ACTIVE, OPTOUT, REMOVED, UNCONFIRMED.

Parameters:

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

Returns:

  • (ResultSet<Contact>)

    a ResultSet of Contacts



65
66
67
# File 'lib/constantcontact/api.rb', line 65

def get_contacts(params = {})
  @contact_service.get_contacts(params)
end

#get_contacts_from_list(list, param = nil) ⇒ Array<Contact>

Get contact that belong to a specific list from a previous getContactsFromList call

Parameters:

  • list (Mixed)
    • Integer id of the list or ContactList object

  • param (Mixed) (defaults to: nil)
    • denotes the number of results per set, limited to 50, or a next parameter provided

Returns:

  • (Array<Contact>)

    An array of contacts

Raises:

  • (IllegalArgumentException)

    If contact is not an integer or contact



180
181
182
183
184
# File 'lib/constantcontact/api.rb', line 180

def get_contacts_from_list(list, param = nil)
  list_id = to_id(list, 'ContactList')
  param = determine_param(param)
  @list_service.get_contacts_from_list(list_id, param)
end

#get_email_campaign(campaign_id) ⇒ Campaign

Get an individual campaign

Parameters:

  • campaign_id (Integer)
    • Valid campaign id

Returns:

  • (Campaign)


203
204
205
# File 'lib/constantcontact/api.rb', line 203

def get_email_campaign(campaign_id)
  @email_marketing_service.get_campaign(campaign_id)
end

#get_email_campaign_bounces(campaign, params = {}) ⇒ ResultSet<BounceActivity>

Get bounces for a campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<BounceActivity>)


327
328
329
330
# File 'lib/constantcontact/api.rb', line 327

def get_email_campaign_bounces(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_tracking_service.get_bounces(campaign_id, params)
end

#get_email_campaign_clicks(campaign, params = {}) ⇒ ResultSet<ClickActivity>

Get clicks for a campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<ClickActivity>)


341
342
343
344
# File 'lib/constantcontact/api.rb', line 341

def get_email_campaign_clicks(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_tracking_service.get_clicks(campaign_id, params)
end

#get_email_campaign_forwards(campaign, params = {}) ⇒ ResultSet<ForwardActivity>

Get forwards for a campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<ForwardActivity>)


369
370
371
372
# File 'lib/constantcontact/api.rb', line 369

def get_email_campaign_forwards(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_tracking_service.get_forwards(campaign_id, params)
end

#get_email_campaign_opens(campaign, params = {}) ⇒ ResultSet<OpenActivity>

Get opens for a campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<OpenActivity>)


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

def get_email_campaign_opens(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_tracking_service.get_opens(campaign_id, params)
end

#get_email_campaign_preview(campaign_id) ⇒ CampaignPreview

Get the preview of an existing campaign

Parameters:

  • campaign_id (Integer)
    • Valid campaign id

Returns:

  • (CampaignPreview)


211
212
213
# File 'lib/constantcontact/api.rb', line 211

def get_email_campaign_preview(campaign_id)
  @email_marketing_service.get_campaign_preview(campaign_id)
end

#get_email_campaign_schedule(campaign, schedule) ⇒ Schedule

Get a specific schedule associated with a given campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • schedule (Mixed)
    • Schedule id or Schedule object itself

Returns:

  • (Schedule)

Raises:

  • IllegalArgumentException



266
267
268
269
270
# File 'lib/constantcontact/api.rb', line 266

def get_email_campaign_schedule(campaign, schedule)
  campaign_id = to_id(campaign, 'Campaign')
  schedule_id = to_id(schedule, 'Schedule')
  @campaign_schedule_service.get_schedule(campaign_id, schedule_id)
end

#get_email_campaign_schedules(campaign) ⇒ Array<Schedule>

Get an array of schedules associated with a given campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

Returns:

  • (Array<Schedule>)


255
256
257
258
# File 'lib/constantcontact/api.rb', line 255

def get_email_campaign_schedules(campaign)
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_schedule_service.get_schedules(campaign_id)
end

#get_email_campaign_sends(campaign, params = {}) ⇒ ResultSet<SendActivity>

Get sends for a campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<SendActivity>)


313
314
315
316
# File 'lib/constantcontact/api.rb', line 313

def get_email_campaign_sends(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_tracking_service.get_sends(campaign_id, params)
end

#get_email_campaign_summary_report(campaign) ⇒ TrackingSummary

Get a reporting summary for a campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

Returns:

  • (TrackingSummary)


392
393
394
395
# File 'lib/constantcontact/api.rb', line 392

def get_email_campaign_summary_report(campaign)
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_tracking_service.get_summary(campaign_id)
end

#get_email_campaign_unsubscribes(campaign, params = {}) ⇒ ResultSet<UnsubscribeActivity>

Get unsubscribes for a campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. created_since - Used to retrieve a list of events since the date and time specified (in ISO-8601 format). next - the next link returned from a previous paginated call. May only be used by itself.

Returns:

  • (ResultSet<UnsubscribeActivity>)
    • Containing a results array of UnsubscribeActivity



383
384
385
386
# File 'lib/constantcontact/api.rb', line 383

def get_email_campaign_unsubscribes(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_tracking_service.get_unsubscribes(campaign_id, params)
end

#get_email_campaigns(params = {}) ⇒ ResultSet<Campaign>

Get a set of campaigns

Parameters:

  • params (Mixed) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 500, default = 50. modified_since - ISO-8601 formatted timestamp. next - the next link returned from a previous paginated call. May only be used by itself. email - the contact by email address to retrieve information for

Returns:

  • (ResultSet<Campaign>)


195
196
197
# File 'lib/constantcontact/api.rb', line 195

def get_email_campaigns(params = {})
  @email_marketing_service.get_campaigns(params)
end

#get_event(event) ⇒ Event

Get an event

Parameters:

  • event (Event)
    • event id or object to be retrieved

Returns:

  • (Event)


574
575
576
# File 'lib/constantcontact/api.rb', line 574

def get_event(event)
  @event_spot_service.get_event(event)
end

#get_event_fee(event, fee) ⇒ EventFee

Get an event fee

Parameters:

  • event (Event)
    • Event fee corresponds to

  • fee (EventFee)
    • Fee to retrieve

Returns:

  • (EventFee)


623
624
625
# File 'lib/constantcontact/api.rb', line 623

def get_event_fee(event, fee)
  @event_spot_service.get_fee(event, fee)
end

#get_event_fees(event) ⇒ <Array>EventFee

Get a list of event fees

Parameters:

  • event (Event)
    • Event to get fees of

Returns:

  • (<Array>EventFee)


614
615
616
# File 'lib/constantcontact/api.rb', line 614

def get_event_fees(event)
  @event_spot_service.get_fees(event)
end

#get_event_item(event_id, item_id) ⇒ EventItem

Get an individual event item

Parameters:

  • event_id (Integer)
    • id of event to retrieve item for

  • item_id (Integer)
    • id of item to be retrieved

Returns:

  • (EventItem)


684
685
686
# File 'lib/constantcontact/api.rb', line 684

def get_event_item(event_id, item_id)
  @event_spot_service.get_event_item(event_id, item_id)
end

#get_event_item_attribute(event_id, item_id, attribute_id) ⇒ EventItemAttribute

Get an individual event item attribute

Parameters:

  • event_id (Integer)
    • id of event to retrieve item for

  • item_id (Integer)
    • id of item to retrieve attribute for

  • attribute_id (Integer)
    • id of attribute to be retrieved

Returns:

  • (EventItemAttribute)


730
731
732
# File 'lib/constantcontact/api.rb', line 730

def get_event_item_attribute(event_id, item_id, attribute_id)
  @event_spot_service.get_event_item_attribute(event_id, item_id, attribute_id)
end

#get_event_item_attributes(event_id, item_id) ⇒ Array<EventItemAttribute>

Get an array of attributes for an individual event item

Parameters:

  • event_id (Integer)
    • event id to retrieve item for

  • item_id (Integer)
    • event item id to retrieve attributes for

Returns:

  • (Array<EventItemAttribute>)


720
721
722
# File 'lib/constantcontact/api.rb', line 720

def get_event_item_attributes(event_id, item_id)
  @event_spot_service.get_event_item_attributes(event_id, item_id)
end

#get_event_items(event_id) ⇒ Array<EventItem>

Get an array of event items for an individual event

Parameters:

  • event_id (Integer)
    • event id to retrieve items for

Returns:

  • (Array<EventItem>)


675
676
677
# File 'lib/constantcontact/api.rb', line 675

def get_event_items(event_id)
  @event_spot_service.get_event_items(event_id)
end

#get_event_registrant(event, registrant) ⇒ Registrant

Get an event registrant

Parameters:

  • event (Event)
    • Event registrant corresponds to

  • registrant (Registrant)
    • registrant details

Returns:

  • (Registrant)


667
668
669
# File 'lib/constantcontact/api.rb', line 667

def get_event_registrant(event, registrant)
  @event_spot_service.get_registrant(event, registrant)
end

#get_event_registrants(event) ⇒ ResultSet<Registrant>

Get a set of event registrants

Parameters:

  • event (Event)
    • Event fee corresponds to

Returns:

  • (ResultSet<Registrant>)


658
659
660
# File 'lib/constantcontact/api.rb', line 658

def get_event_registrants(event)
  @event_spot_service.get_registrants(event)
end

#get_eventsResultSet<Event>

Get a list of events

Returns:

  • (ResultSet<Event>)


566
567
568
# File 'lib/constantcontact/api.rb', line 566

def get_events()
  @event_spot_service.get_events()
end

#get_library_file(file_id) ⇒ LibraryFile

Retrieve a MyLibrary file using the file_id path parameter

Parameters:

  • file_id (String)
    • Specifies the MyLibrary file for which to retrieve information

Returns:

  • (LibraryFile)


927
928
929
# File 'lib/constantcontact/api.rb', line 927

def get_library_file(file_id)
  @library_service.get_library_file(file_id)
end

#get_library_files(params = {}) ⇒ ResultSet<LibraryFile>

Retrieve a collection of Library files in the Constant Contact account

Parameters:

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: type - Specifies the type of files to retrieve, valid values are : ALL, IMAGES, or DOCUMENTS source - Specifies to retrieve files from a particular source, valid values are :

    ALL - (default) files from all sources
    MyComputer
    StockImage
    Facebook
    Instagram
    Shutterstock
    Mobile

    limit - Specifies the number of results displayed per page of output, from 1 - 1000, default = 50.

Returns:

  • (ResultSet<LibraryFile>)


908
909
910
# File 'lib/constantcontact/api.rb', line 908

def get_library_files(params = {})
  @library_service.get_library_files(params)
end

#get_library_files_by_folder(folder_id, params = {}) ⇒ ResultSet<LibraryFile>

Retrieves all files from a MyLibrary folder specified by the folder_id path parameter

Parameters:

  • folder_id (String)
    • Specifies the folder from which to retrieve files

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: limit - Specifies the number of results displayed per page of output, from 1 - 50, default = 50.

Returns:

  • (ResultSet<LibraryFile>)


919
920
921
# File 'lib/constantcontact/api.rb', line 919

def get_library_files_by_folder(folder_id, params = {})
  @library_service.get_library_files_by_folder(folder_id, params)
end

#get_library_files_upload_status(file_id) ⇒ Array<UploadStatus>

Retrieve the upload status for one or more MyLibrary files using the file_id path parameter; separate multiple file IDs with a comma

Parameters:

  • file_id (String)
    • Specifies the files for which to retrieve upload status information

Returns:

  • (Array<UploadStatus>)


970
971
972
# File 'lib/constantcontact/api.rb', line 970

def get_library_files_upload_status(file_id)
  @library_service.get_library_files_upload_status(file_id)
end

#get_library_folder(folder_id) ⇒ LibraryFolder

Retrieve a specific MyLibrary folder using the folder_id path parameter

Parameters:

  • folder_id (String)
    • The ID for the folder to return

Returns:

  • (LibraryFolder)


844
845
846
# File 'lib/constantcontact/api.rb', line 844

def get_library_folder(folder_id)
  @library_service.get_library_folder(folder_id)
end

#get_library_folders(params = {}) ⇒ ResultSet<LibraryFolder>

Retrieve a list of MyLibrary folders

Parameters:

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: sort_by - The method to sort by, valid values are :

    CREATED_DATE - sorts by date folder was added, ascending (earliest to latest)
    CREATED_DATE_DESC - (default) sorts by date folder was added, descending (latest to earliest)
    MODIFIED_DATE - sorts by date folder was last modified, ascending (earliest to latest)
    MODIFIED_DATE_DESC - sorts by date folder was last modified, descending (latest to earliest)
    NAME - sorts alphabetically by folder name, a to z
    NAME_DESC - sorts alphabetically by folder name, z to a

    limit - Specifies the number of results displayed per page of output, from 1 - 50, default = 50.

Returns:

  • (ResultSet<LibraryFolder>)


828
829
830
# File 'lib/constantcontact/api.rb', line 828

def get_library_folders(params = {})
  @library_service.get_library_folders(params)
end

#get_library_infoLibrarySummary

Retrieve MyLibrary usage information

Returns:

  • (LibrarySummary)


811
812
813
# File 'lib/constantcontact/api.rb', line 811

def get_library_info()
  @library_service.get_library_info()
end

#get_library_trash(params = {}) ⇒ ResultSet<LibraryFile>

Retrieve all files in the Trash folder

Parameters:

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include: type - Specifies the type of files to retrieve, valid values are : ALL, IMAGES, or DOCUMENTS sort_by - The method to sort by, valid values are :

    ADDED_DATE - sorts by date folder was added, ascending (earliest to latest)
    ADDED_DATE_DESC - (default) sorts by date folder was added, descending (latest to earliest)
    MODIFIED_DATE - sorts by date folder was last modified, ascending (earliest to latest)
    MODIFIED_DATE_DESC - sorts by date folder was last modified, descending (latest to earliest)
    NAME - sorts alphabetically by file name, a to z
    NAME_DESC - sorts alphabetically by file name, z to a
    SIZE - sorts by file size, smallest to largest
    SIZE_DESC - sorts by file size, largest to smallest
    DIMENSION - sorts by file dimensions (hxw), smallest to largest
    DIMENSION_DESC - sorts by file dimensions (hxw), largest to smallest

    limit - Specifies the number of results displayed per page of output, from 1 - 50, default = 50.

Returns:

  • (ResultSet<LibraryFile>)


882
883
884
# File 'lib/constantcontact/api.rb', line 882

def get_library_trash(params = {})
  @library_service.get_library_trash(params)
end

#get_list(list_id) ⇒ ContactList

Get an individual list

Parameters:

  • list_id (Integer)
    • Id of the list to retrieve

Returns:

  • (ContactList)


153
154
155
# File 'lib/constantcontact/api.rb', line 153

def get_list(list_id)
  @list_service.get_list(list_id)
end

#get_lists(params = {}) ⇒ Array<ContactList>

Get lists

Parameters:

  • params (Hash) (defaults to: {})
    • hash of query parameters and values to append to the request.

    Allowed parameters include:

    • modified_since - ISO-8601 formatted timestamp.

Returns:

  • (Array<ContactList>)

    Array of ContactList objects



145
146
147
# File 'lib/constantcontact/api.rb', line 145

def get_lists(params = {})
  @list_service.get_lists(params)
end

#get_promocode(event_id, promocode_id) ⇒ Promocode

Get an individual promocode

Parameters:

  • event_id (Integer)
    • id of event to retrieve item for

  • promocode_id (Integer)
    • id of item to be retrieved

Returns:

  • (Promocode)


777
778
779
# File 'lib/constantcontact/api.rb', line 777

def get_promocode(event_id, promocode_id)
  @event_spot_service.get_promocode(event_id, promocode_id)
end

#get_promocodes(event_id) ⇒ Array<Promocode>

Get an array of promocodes for an individual event

Parameters:

  • event_id (Integer)
    • event id to retrieve promocodes for

Returns:

  • (Array<Promocode>)


768
769
770
# File 'lib/constantcontact/api.rb', line 768

def get_promocodes(event_id)
  @event_spot_service.get_promocodes(event_id)
end

#get_verified_email_addresses(status = nil) ⇒ Array<VerifiedEmailAddress>

Get verified addresses for the account

Parameters:

  • status (String) (defaults to: nil)
    • status to filter query results by

Returns:

  • (Array<VerifiedEmailAddress>)

    an array of email addresses



49
50
51
52
53
# File 'lib/constantcontact/api.rb', line 49

def get_verified_email_addresses(status = nil)
  params = {}
  params['status'] = status if status
  @account_service.get_verified_email_addresses(params)
end

#move_library_files(folder_id, file_id) ⇒ Array<MoveResults>

Move one or more MyLibrary files to a different folder in the user's account specify the destination folder using the folder_id path parameter.

Parameters:

  • folder_id (String)
    • Specifies the destination MyLibrary folder to which the files will be moved

  • file_id (String)
    • Specifies the files to move, in a string of comma separated file ids (e.g. 8,9)

Returns:

  • (Array<MoveResults>)


980
981
982
# File 'lib/constantcontact/api.rb', line 980

def move_library_files(folder_id, file_id)
  @library_service.move_library_files(folder_id, file_id)
end

#publish_event(event) ⇒ Event

Publish an event

Parameters:

  • event (Event)
    • Event to publish

Returns:

  • (Event)


598
599
600
# File 'lib/constantcontact/api.rb', line 598

def publish_event(event)
  @event_spot_service.publish_event(event)
end

#send_email_campaign_test(campaign, test_send) ⇒ TestSend

Send a test send of a campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • test_send (TestSend)
    • test send details

Returns:

  • (TestSend)


299
300
301
302
# File 'lib/constantcontact/api.rb', line 299

def send_email_campaign_test(campaign, test_send)
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_schedule_service.send_test(campaign_id, test_send)
end

#update_contact(contact, action_by_visitor = false) ⇒ Contact

Update an individual contact

Parameters:

  • contact (Contact)
    • Contact to update

  • action_by_visitor (Boolean) (defaults to: false)
    • if the action is being taken by the visitor

Returns:

  • (Contact)


133
134
135
136
137
# File 'lib/constantcontact/api.rb', line 133

def update_contact(contact, action_by_visitor = false)
  params = {}
  params['action_by'] = 'ACTION_BY_VISITOR' if action_by_visitor
  @contact_service.update_contact(contact, params)
end

#update_email_campaign(campaign) ⇒ Campaign

Update a specific campaign

Parameters:

  • campaign (Campaign)
    • Campaign to be updated

Returns:

  • (Campaign)
    • updated campaign



237
238
239
# File 'lib/constantcontact/api.rb', line 237

def update_email_campaign(campaign)
  @email_marketing_service.update_campaign(campaign)
end

#update_email_campaign_schedule(campaign, schedule) ⇒ Schedule

Update a specific schedule associated with a given campaign

Parameters:

  • campaign (Mixed)
    • Campaign id or Campaign object itself

  • schedule (Schedule)
    • Schedule to be updated

Returns:

  • (Schedule)


277
278
279
280
# File 'lib/constantcontact/api.rb', line 277

def update_email_campaign_schedule(campaign, schedule)
  campaign_id = to_id(campaign, 'Campaign')
  @campaign_schedule_service.update_schedule(campaign_id, schedule)
end

#update_event(event) ⇒ Event

Update an event

Parameters:

  • event (Event|Hash)
    • Event details stored in an object that responds to to_json and has an :id attribute

Returns:

  • (Event)


590
591
592
# File 'lib/constantcontact/api.rb', line 590

def update_event(event)
  @event_spot_service.update_event(event)
end

#update_event_fee(event, fee) ⇒ EventFee

Update an event fee

Parameters:

  • event (Event)
    • Event fee corresponds to

  • fee (EventFee)
    • Fee details

Returns:

  • (EventFee)


641
642
643
# File 'lib/constantcontact/api.rb', line 641

def update_event_fee(event, fee)
  @event_spot_service.update_fee(event, fee)
end

#update_event_item(event_id, event_item) ⇒ EventItem

Update a specific event item for an event

Parameters:

  • event_id (Integer)
    • id of event associated with the event item

  • event_item (EventItem)
    • event item to be updated

Returns:

  • (EventItem)


711
712
713
# File 'lib/constantcontact/api.rb', line 711

def update_event_item(event_id, event_item)
  @event_spot_service.update_event_item(event_id, event_item)
end

#update_event_item_attribute(event_id, item_id, event_item_attribute) ⇒ EventItemAttribute

Update a specific event item attribute for an event item

Parameters:

  • event_id (Integer)
    • id of event associated with the event item

  • item_id (Integer)
    • id of event item associated with the event item attribute

  • event_item_attribute (EventItemAttribute)
    • event item to be updated

Returns:

  • (EventItemAttribute)


760
761
762
# File 'lib/constantcontact/api.rb', line 760

def update_event_item_attribute(event_id, item_id, event_item_attribute)
  @event_spot_service.update_event_item_attribute(event_id, item_id, event_item_attribute)
end

#update_library_file(file) ⇒ LibraryFile

Update information for a specific MyLibrary file

Parameters:

  • file (LibraryFile)
    • Library File to be updated

Returns:

  • (LibraryFile)


951
952
953
# File 'lib/constantcontact/api.rb', line 951

def update_library_file(file)
  @library_service.update_library_file(file)
end

#update_library_folder(folder) ⇒ LibraryFolder

Update a specific MyLibrary folder

Parameters:

  • folder (LibraryFolder)
    • MyLibrary folder to be updated

Returns:

  • (LibraryFolder)


852
853
854
# File 'lib/constantcontact/api.rb', line 852

def update_library_folder(folder)
  @library_service.update_library_folder(folder)
end

#update_list(list) ⇒ ContactList

Update a contact list

Parameters:

  • list (ContactList)
    • ContactList to update

Returns:

  • (ContactList)


169
170
171
# File 'lib/constantcontact/api.rb', line 169

def update_list(list)
  @list_service.update_list(list)
end

#update_promocode(event_id, promocode) ⇒ Promocode

Update a specific promocode for an event

Parameters:

  • event_id (Integer)
    • id of event associated with the promocode

  • promocode (Promocode)
    • promocode to be updated

Returns:

  • (Promocode)


804
805
806
# File 'lib/constantcontact/api.rb', line 804

def update_promocode(event_id, promocode)
  @event_spot_service.update_promocode(event_id, promocode)
end