Class: ConstantContact::Api

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

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



13
14
15
16
17
18
19
20
21
22
# File 'lib/constantcontact/api.rb', line 13

def initialize(api_key = nil, access_token = nil)
  Services::BaseService.api_key = api_key || Util::Config.get('auth.api_key')
  Services::BaseService.access_token = access_token
  if Services::BaseService.api_key.nil? || Services::BaseService.api_key == ''
    raise ArgumentError.new(Util::Config.get('errors.api_key_missing'))
  end
  if Services::BaseService.access_token.nil? || Services::BaseService.access_token == ''
    raise ArgumentError.new(Util::Config.get('errors.access_token_missing'))
  end
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)


518
519
520
# File 'lib/constantcontact/api.rb', line 518

def add_clear_lists_activity(lists)
  Services::ActivityService.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)


76
77
78
79
80
# File 'lib/constantcontact/api.rb', line 76

def add_contact(contact, action_by_visitor = false)
  params = {}
  params['action_by'] = 'ACTION_BY_VISITOR' if action_by_visitor
  Services::ContactService.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)


500
501
502
# File 'lib/constantcontact/api.rb', line 500

def add_create_contacts_activity(add_contacts)
  Services::ActivityService.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)


510
511
512
# File 'lib/constantcontact/api.rb', line 510

def add_create_contacts_activity_from_file(file_name, contents, lists)
  Services::ActivityService.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



215
216
217
# File 'lib/constantcontact/api.rb', line 215

def add_email_campaign(campaign)
  Services::EmailMarketingService.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



232
233
234
235
# File 'lib/constantcontact/api.rb', line 232

def add_email_campaign_schedule(campaign, schedule)
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignScheduleService.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)


568
569
570
# File 'lib/constantcontact/api.rb', line 568

def add_event(event)
  Services::EventSpotService.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)


618
619
620
# File 'lib/constantcontact/api.rb', line 618

def add_event_fee(event, fee)
  Services::EventSpotService.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)


679
680
681
# File 'lib/constantcontact/api.rb', line 679

def add_event_item(event_id, event_item)
  Services::EventSpotService.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)


726
727
728
# File 'lib/constantcontact/api.rb', line 726

def add_event_item_attribute(event_id, item_id, event_item_attribute)
  Services::EventSpotService.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)


545
546
547
# File 'lib/constantcontact/api.rb', line 545

def add_export_contacts_activity(export_contacts)
  Services::ActivityService.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)


929
930
931
# File 'lib/constantcontact/api.rb', line 929

def add_library_file(file_name, folder_id, description, source, file_type, contents)
  Services::LibraryService.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)


822
823
824
# File 'lib/constantcontact/api.rb', line 822

def add_library_folder(folder)
  Services::LibraryService.add_library_folder(folder)
end

#add_list(list) ⇒ ContactList

Add a new list to an account

Parameters:

  • list (ContactList)
    • List to add

Returns:

  • (ContactList)


147
148
149
# File 'lib/constantcontact/api.rb', line 147

def add_list(list)
  Services::ListService.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)


772
773
774
# File 'lib/constantcontact/api.rb', line 772

def add_promocode(event_id, promocode)
  Services::EventSpotService.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)


527
528
529
# File 'lib/constantcontact/api.rb', line 527

def add_remove_contacts_from_lists_activity(email_addresses, lists)
  Services::ActivityService.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)


537
538
539
# File 'lib/constantcontact/api.rb', line 537

def add_remove_contacts_from_lists_activity_from_file(file_name, contents, lists)
  Services::ActivityService.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)


592
593
594
# File 'lib/constantcontact/api.rb', line 592

def cancel_event(event)
  Services::EventSpotService.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



87
88
89
90
# File 'lib/constantcontact/api.rb', line 87

def delete_contact(contact)
  contact_id = to_id(contact, 'Contact')
  Services::ContactService.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



108
109
110
111
112
# File 'lib/constantcontact/api.rb', line 108

def delete_contact_from_list(contact, list)
  contact_id = to_id(contact, 'Contact')
  list_id = to_id(list, 'ContactList')
  Services::ContactService.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



97
98
99
100
# File 'lib/constantcontact/api.rb', line 97

def delete_contact_from_lists(contact)
  contact_id = to_id(contact, 'Contact')
  Services::ContactService.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



206
207
208
209
# File 'lib/constantcontact/api.rb', line 206

def delete_email_campaign(campaign)
  campaign_id = to_id(campaign, 'Campaign')
  Services::EmailMarketingService.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



274
275
276
277
278
# File 'lib/constantcontact/api.rb', line 274

def delete_email_campaign_schedule(campaign, schedule)
  campaign_id = to_id(campaign, 'Campaign')
  schedule_id = to_id(schedule, 'Schedule')
  Services::CampaignScheduleService.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)


636
637
638
# File 'lib/constantcontact/api.rb', line 636

def delete_event_fee(event, fee)
  Services::EventSpotService.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)


688
689
690
# File 'lib/constantcontact/api.rb', line 688

def delete_event_item(event_id, item_id)
  Services::EventSpotService.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)


736
737
738
# File 'lib/constantcontact/api.rb', line 736

def delete_event_item_attribute(event_id, item_id, attribute_id)
  Services::EventSpotService.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)


947
948
949
# File 'lib/constantcontact/api.rb', line 947

def delete_library_file(file_id)
  Services::LibraryService.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)


846
847
848
# File 'lib/constantcontact/api.rb', line 846

def delete_library_folder(folder_id)
  Services::LibraryService.delete_library_folder(folder_id)
end

#delete_library_trashBoolean

Permanently deletes all files in the Trash folder

Returns:

  • (Boolean)


875
876
877
# File 'lib/constantcontact/api.rb', line 875

def delete_library_trash()
  Services::LibraryService.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)


781
782
783
# File 'lib/constantcontact/api.rb', line 781

def delete_promocode(event_id, promocode_id)
  Services::EventSpotService.delete_promocode(event_id, promocode_id)
end

#get_account_infoAccountInfo

Get a summary of account information

Returns:

  • (AccountInfo)


27
28
29
# File 'lib/constantcontact/api.rb', line 27

def ()
  Services::AccountService.()
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>)


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

def get_activities(params = {})
  Services::ActivityService.get_activities(params)
end

#get_activity(activity_id) ⇒ Activity

Get a single activity by id

Parameters:

  • activity_id (String)
    • Activity id

Returns:

  • (Activity)


492
493
494
# File 'lib/constantcontact/api.rb', line 492

def get_activity(activity_id)
  Services::ActivityService.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)


59
60
61
# File 'lib/constantcontact/api.rb', line 59

def get_contact(contact_id)
  Services::ContactService.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>)


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

def get_contact_bounces(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  Services::ContactTrackingService.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



67
68
69
# File 'lib/constantcontact/api.rb', line 67

def get_contact_by_email(email)
  Services::ContactService.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>)


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

def get_contact_clicks(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  Services::ContactTrackingService.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>)


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

def get_contact_forwards(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  Services::ContactTrackingService.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>)


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

def get_contact_opens(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  Services::ContactTrackingService.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>)


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

def get_contact_sends(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  Services::ContactTrackingService.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)


471
472
473
474
# File 'lib/constantcontact/api.rb', line 471

def get_contact_summary_report(contact)
  contact_id = to_id(contact, 'Contact')
  Services::ContactTrackingService.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



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

def get_contact_unsubscribes(contact, params = {})
  contact_id = to_id(contact, 'Contact')
  Services::ContactTrackingService.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



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

def get_contacts(params = {})
  Services::ContactService.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



166
167
168
169
170
# File 'lib/constantcontact/api.rb', line 166

def get_contacts_from_list(list, param = nil)
  list_id = to_id(list, 'ContactList')
  param = determine_param(param)
  Services::ListService.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)


189
190
191
# File 'lib/constantcontact/api.rb', line 189

def get_email_campaign(campaign_id)
  Services::EmailMarketingService.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>)


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

def get_email_campaign_bounces(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignTrackingService.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>)


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

def get_email_campaign_clicks(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignTrackingService.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>)


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

def get_email_campaign_forwards(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignTrackingService.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>)


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

def get_email_campaign_opens(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignTrackingService.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)


197
198
199
# File 'lib/constantcontact/api.rb', line 197

def get_email_campaign_preview(campaign_id)
  Services::EmailMarketingService.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



252
253
254
255
256
# File 'lib/constantcontact/api.rb', line 252

def get_email_campaign_schedule(campaign, schedule)
  campaign_id = to_id(campaign, 'Campaign')
  schedule_id = to_id(schedule, 'Schedule')
  Services::CampaignScheduleService.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>)


241
242
243
244
# File 'lib/constantcontact/api.rb', line 241

def get_email_campaign_schedules(campaign)
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignScheduleService.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>)


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

def get_email_campaign_sends(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignTrackingService.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)


378
379
380
381
# File 'lib/constantcontact/api.rb', line 378

def get_email_campaign_summary_report(campaign)
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignTrackingService.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



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

def get_email_campaign_unsubscribes(campaign, params = {})
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignTrackingService.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>)


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

def get_email_campaigns(params = {})
  Services::EmailMarketingService.get_campaigns(params)
end

#get_event(event) ⇒ Event

Get an event

Parameters:

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

Returns:

  • (Event)


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

def get_event(event)
  Services::EventSpotService.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)


609
610
611
# File 'lib/constantcontact/api.rb', line 609

def get_event_fee(event, fee)
  Services::EventSpotService.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)


600
601
602
# File 'lib/constantcontact/api.rb', line 600

def get_event_fees(event)
  Services::EventSpotService.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)


670
671
672
# File 'lib/constantcontact/api.rb', line 670

def get_event_item(event_id, item_id)
  Services::EventSpotService.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)


716
717
718
# File 'lib/constantcontact/api.rb', line 716

def get_event_item_attribute(event_id, item_id, attribute_id)
  Services::EventSpotService.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>)


706
707
708
# File 'lib/constantcontact/api.rb', line 706

def get_event_item_attributes(event_id, item_id)
  Services::EventSpotService.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>)


661
662
663
# File 'lib/constantcontact/api.rb', line 661

def get_event_items(event_id)
  Services::EventSpotService.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)


653
654
655
# File 'lib/constantcontact/api.rb', line 653

def get_event_registrant(event, registrant)
  Services::EventSpotService.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>)


644
645
646
# File 'lib/constantcontact/api.rb', line 644

def get_event_registrants(event)
  Services::EventSpotService.get_registrants(event)
end

#get_eventsResultSet<Event>

Get a list of events

Returns:

  • (ResultSet<Event>)


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

def get_events()
  Services::EventSpotService.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)


913
914
915
# File 'lib/constantcontact/api.rb', line 913

def get_library_file(file_id)
  Services::LibraryService.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>)


894
895
896
# File 'lib/constantcontact/api.rb', line 894

def get_library_files(params = {})
  Services::LibraryService.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>)


905
906
907
# File 'lib/constantcontact/api.rb', line 905

def get_library_files_by_folder(folder_id, params = {})
  Services::LibraryService.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>)


956
957
958
# File 'lib/constantcontact/api.rb', line 956

def get_library_files_upload_status(file_id)
  Services::LibraryService.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)


830
831
832
# File 'lib/constantcontact/api.rb', line 830

def get_library_folder(folder_id)
  Services::LibraryService.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>)


814
815
816
# File 'lib/constantcontact/api.rb', line 814

def get_library_folders(params = {})
  Services::LibraryService.get_library_folders(params)
end

#get_library_infoLibrarySummary

Retrieve MyLibrary usage information

Returns:

  • (LibrarySummary)


797
798
799
# File 'lib/constantcontact/api.rb', line 797

def get_library_info()
  Services::LibraryService.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>)


868
869
870
# File 'lib/constantcontact/api.rb', line 868

def get_library_trash(params = {})
  Services::LibraryService.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)


139
140
141
# File 'lib/constantcontact/api.rb', line 139

def get_list(list_id)
  Services::ListService.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



131
132
133
# File 'lib/constantcontact/api.rb', line 131

def get_lists(params = {})
  Services::ListService.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)


763
764
765
# File 'lib/constantcontact/api.rb', line 763

def get_promocode(event_id, promocode_id)
  Services::EventSpotService.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>)


754
755
756
# File 'lib/constantcontact/api.rb', line 754

def get_promocodes(event_id)
  Services::EventSpotService.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



35
36
37
38
39
# File 'lib/constantcontact/api.rb', line 35

def get_verified_email_addresses(status = nil)
  params = {}
  params['status'] = status if status
  Services::AccountService.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>)


966
967
968
# File 'lib/constantcontact/api.rb', line 966

def move_library_files(folder_id, file_id)
  Services::LibraryService.move_library_files(folder_id, file_id)
end

#publish_event(event) ⇒ Event

Publish an event

Parameters:

  • event (Event)
    • Event to publish

Returns:

  • (Event)


584
585
586
# File 'lib/constantcontact/api.rb', line 584

def publish_event(event)
  Services::EventSpotService.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)


285
286
287
288
# File 'lib/constantcontact/api.rb', line 285

def send_email_campaign_test(campaign, test_send)
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignScheduleService.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)


119
120
121
122
123
# File 'lib/constantcontact/api.rb', line 119

def update_contact(contact, action_by_visitor = false)
  params = {}
  params['action_by'] = 'ACTION_BY_VISITOR' if action_by_visitor
  Services::ContactService.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



223
224
225
# File 'lib/constantcontact/api.rb', line 223

def update_email_campaign(campaign)
  Services::EmailMarketingService.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)


263
264
265
266
# File 'lib/constantcontact/api.rb', line 263

def update_email_campaign_schedule(campaign, schedule)
  campaign_id = to_id(campaign, 'Campaign')
  Services::CampaignScheduleService.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)


576
577
578
# File 'lib/constantcontact/api.rb', line 576

def update_event(event)
  Services::EventSpotService.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)


627
628
629
# File 'lib/constantcontact/api.rb', line 627

def update_event_fee(event, fee)
  Services::EventSpotService.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)


697
698
699
# File 'lib/constantcontact/api.rb', line 697

def update_event_item(event_id, event_item)
  Services::EventSpotService.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)


746
747
748
# File 'lib/constantcontact/api.rb', line 746

def update_event_item_attribute(event_id, item_id, event_item_attribute)
  Services::EventSpotService.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)


937
938
939
# File 'lib/constantcontact/api.rb', line 937

def update_library_file(file)
  Services::LibraryService.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)


838
839
840
# File 'lib/constantcontact/api.rb', line 838

def update_library_folder(folder)
  Services::LibraryService.update_library_folder(folder)
end

#update_list(list) ⇒ ContactList

Update a contact list

Parameters:

  • list (ContactList)
    • ContactList to update

Returns:

  • (ContactList)


155
156
157
# File 'lib/constantcontact/api.rb', line 155

def update_list(list)
  Services::ListService.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)


790
791
792
# File 'lib/constantcontact/api.rb', line 790

def update_promocode(event_id, promocode)
  Services::EventSpotService.update_promocode(event_id, promocode)
end