Class: ConstantContact::Api
- Inherits:
-
Object
- Object
- ConstantContact::Api
- Defined in:
- lib/constantcontact/api.rb
Instance Method Summary collapse
-
#add_clear_lists_activity(lists) ⇒ Activity
Add a ClearLists Activity to remove all contacts from the provided lists.
-
#add_contact(contact, action_by_visitor = false) ⇒ Contact
Add a new contact to an account.
-
#add_create_contacts_activity(add_contacts) ⇒ Activity
Add an AddContacts activity to add contacts in bulk.
-
#add_create_contacts_activity_from_file(file_name, contents, lists) ⇒ Activity
Create an Add Contacts Activity from a file.
-
#add_email_campaign(campaign) ⇒ Campaign
Create a new campaign.
-
#add_email_campaign_schedule(campaign, schedule) ⇒ Campaign
Schedule a campaign to be sent.
-
#add_event(event) ⇒ Event
Create an event.
-
#add_event_fee(event, fee) ⇒ EventFee
Create an event fee.
-
#add_event_item(event_id, event_item) ⇒ EventItem
Create a new event item for an event.
-
#add_event_item_attribute(event_id, item_id, event_item_attribute) ⇒ EventItemAttribute
Create a new event item attribute for an event item.
-
#add_export_contacts_activity(export_contacts) ⇒ Activity
Create an Export Contacts Activity.
-
#add_library_file(file_name, folder_id, description, source, file_type, contents) ⇒ LibraryFile
Adds a new MyLibrary file using the multipart content-type.
-
#add_library_folder(folder) ⇒ LibraryFolder
Create a new MyLibrary folder.
-
#add_list(list) ⇒ ContactList
Add a new list to an account.
-
#add_promocode(event_id, promocode) ⇒ Promocode
Create a new promocode for an event.
-
#add_remove_contacts_from_lists_activity(email_addresses, lists) ⇒ Activity
Add a Remove Contacts From Lists Activity.
-
#add_remove_contacts_from_lists_activity_from_file(file_name, contents, lists) ⇒ Activity
Add a Remove Contacts From Lists Activity from a file.
-
#cancel_event(event) ⇒ Event
Cancel an event.
-
#delete_contact(contact) ⇒ Boolean
Sets an individual contact to ‘REMOVED’ status.
-
#delete_contact_from_list(contact, list) ⇒ Boolean
Delete a contact from all contact lists.
-
#delete_contact_from_lists(contact) ⇒ Boolean
Delete a contact from all contact lists.
-
#delete_email_campaign(campaign) ⇒ Boolean
Delete an individual campaign.
-
#delete_email_campaign_schedule(campaign, schedule) ⇒ Boolean
Delete a specific schedule associated with a given campaign.
-
#delete_event_fee(event, fee) ⇒ Boolean
Delete an event fee.
-
#delete_event_item(event_id, item_id) ⇒ Boolean
Delete a specific event item for an event.
-
#delete_event_item_attribute(event_id, item_id, attribute_id) ⇒ Boolean
Delete a specific event item for an event.
-
#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.
-
#delete_library_folder(folder_id) ⇒ Boolean
Delete a MyLibrary folder.
-
#delete_library_trash ⇒ Boolean
Permanently deletes all files in the Trash folder.
-
#delete_promocode(event_id, promocode_id) ⇒ Boolean
Delete a specific promocode for an event.
-
#get_account_info ⇒ AccountInfo
Get a summary of account information.
-
#get_activities(params = {}) ⇒ Array<Activity>
Get an array of activities.
-
#get_activity(activity_id) ⇒ Activity
Get a single activity by id.
-
#get_contact(contact_id) ⇒ Contact
Get an individual contact.
-
#get_contact_bounces(contact, params = {}) ⇒ ResultSet<BounceActivity>
Get bounces for a Contact.
-
#get_contact_by_email(email) ⇒ ResultSet<Contact>
Get contacts with a specified email eaddress.
-
#get_contact_clicks(contact, params = {}) ⇒ ResultSet<ClickActivity>
Get clicks for a Contact.
-
#get_contact_forwards(contact, params = {}) ⇒ ResultSet<ForwardActivity>
Get forwards for a Contact.
-
#get_contact_opens(contact, params = {}) ⇒ ResultSet<OpenActivity>
Get opens for a Contact.
-
#get_contact_sends(contact, params = {}) ⇒ ResultSet<SendActivity>
Get sends for a Contact.
-
#get_contact_summary_report(contact) ⇒ TrackingSummary
Get a reporting summary for a Contact.
-
#get_contact_unsubscribes(contact, params = {}) ⇒ UnsubscribeActivity
Get unsubscribes for a Contact.
-
#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.
-
#get_contacts_from_list(list, param = nil) ⇒ Array<Contact>
Get contact that belong to a specific list from a previous getContactsFromList call.
-
#get_email_campaign(campaign_id) ⇒ Campaign
Get an individual campaign.
-
#get_email_campaign_bounces(campaign, params = {}) ⇒ ResultSet<BounceActivity>
Get bounces for a campaign.
-
#get_email_campaign_clicks(campaign, params = {}) ⇒ ResultSet<ClickActivity>
Get clicks for a campaign.
-
#get_email_campaign_forwards(campaign, params = {}) ⇒ ResultSet<ForwardActivity>
Get forwards for a campaign.
-
#get_email_campaign_opens(campaign, params = {}) ⇒ ResultSet<OpenActivity>
Get opens for a campaign.
-
#get_email_campaign_preview(campaign_id) ⇒ CampaignPreview
Get the preview of an existing campaign.
-
#get_email_campaign_schedule(campaign, schedule) ⇒ Schedule
Get a specific schedule associated with a given campaign.
-
#get_email_campaign_schedules(campaign) ⇒ Array<Schedule>
Get an array of schedules associated with a given campaign.
-
#get_email_campaign_sends(campaign, params = {}) ⇒ ResultSet<SendActivity>
Get sends for a campaign.
-
#get_email_campaign_summary_report(campaign) ⇒ TrackingSummary
Get a reporting summary for a campaign.
-
#get_email_campaign_unsubscribes(campaign, params = {}) ⇒ ResultSet<UnsubscribeActivity>
Get unsubscribes for a campaign.
-
#get_email_campaigns(params = {}) ⇒ ResultSet<Campaign>
Get a set of campaigns.
-
#get_event(event) ⇒ Event
Get an event.
-
#get_event_fee(event, fee) ⇒ EventFee
Get an event fee.
-
#get_event_fees(event) ⇒ <Array>EventFee
Get a list of event fees.
-
#get_event_item(event_id, item_id) ⇒ EventItem
Get an individual event item.
-
#get_event_item_attribute(event_id, item_id, attribute_id) ⇒ EventItemAttribute
Get an individual event item attribute.
-
#get_event_item_attributes(event_id, item_id) ⇒ Array<EventItemAttribute>
Get an array of attributes for an individual event item.
-
#get_event_items(event_id) ⇒ Array<EventItem>
Get an array of event items for an individual event.
-
#get_event_registrant(event, registrant) ⇒ Registrant
Get an event registrant.
-
#get_event_registrants(event) ⇒ ResultSet<Registrant>
Get a set of event registrants.
-
#get_events ⇒ ResultSet<Event>
Get a list of events.
-
#get_library_file(file_id) ⇒ LibraryFile
Retrieve a MyLibrary file using the file_id path parameter.
-
#get_library_files(params = {}) ⇒ ResultSet<LibraryFile>
Retrieve a collection of Library files in the Constant Contact account.
-
#get_library_files_by_folder(folder_id, params = {}) ⇒ ResultSet<LibraryFile>
Retrieves all files from a MyLibrary folder specified by the folder_id path parameter.
-
#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.
-
#get_library_folder(folder_id) ⇒ LibraryFolder
Retrieve a specific MyLibrary folder using the folder_id path parameter.
-
#get_library_folders(params = {}) ⇒ ResultSet<LibraryFolder>
Retrieve a list of MyLibrary folders.
-
#get_library_info ⇒ LibrarySummary
Retrieve MyLibrary usage information.
-
#get_library_trash(params = {}) ⇒ ResultSet<LibraryFile>
Retrieve all files in the Trash folder.
-
#get_list(list_id) ⇒ ContactList
Get an individual list.
-
#get_lists(params = {}) ⇒ Array<ContactList>
Get lists.
-
#get_promocode(event_id, promocode_id) ⇒ Promocode
Get an individual promocode.
-
#get_promocodes(event_id) ⇒ Array<Promocode>
Get an array of promocodes for an individual event.
-
#get_verified_email_addresses(status = nil) ⇒ Array<VerifiedEmailAddress>
Get verified addresses for the account.
-
#initialize(api_key = nil, access_token = nil) ⇒ Object
constructor
Class constructor.
-
#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.
-
#publish_event(event) ⇒ Event
Publish an event.
-
#send_email_campaign_test(campaign, test_send) ⇒ TestSend
Send a test send of a campaign.
-
#update_contact(contact, action_by_visitor = false) ⇒ Contact
Update an individual contact.
-
#update_email_campaign(campaign) ⇒ Campaign
Update a specific campaign.
-
#update_email_campaign_schedule(campaign, schedule) ⇒ Schedule
Update a specific schedule associated with a given campaign.
-
#update_event(event) ⇒ Event
Update an event.
-
#update_event_fee(event, fee) ⇒ EventFee
Update an event fee.
-
#update_event_item(event_id, event_item) ⇒ EventItem
Update a specific event item for an event.
-
#update_event_item_attribute(event_id, item_id, event_item_attribute) ⇒ EventItemAttribute
Update a specific event item attribute for an event item.
-
#update_library_file(file) ⇒ LibraryFile
Update information for a specific MyLibrary file.
-
#update_library_folder(folder) ⇒ LibraryFolder
Update a specific MyLibrary folder.
-
#update_list(list) ⇒ ContactList
Update a contact list.
-
#update_promocode(event_id, promocode) ⇒ Promocode
Update a specific promocode for an event.
Constructor Details
#initialize(api_key = nil, access_token = nil) ⇒ Object
Class constructor
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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_trash ⇒ Boolean
Permanently deletes all files in the Trash folder
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
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_info ⇒ AccountInfo
Get a summary of account information
27 28 29 |
# File 'lib/constantcontact/api.rb', line 27 def get_account_info() Services::AccountService.get_account_info() end |
#get_activities(params = {}) ⇒ Array<Activity>
Get an array of activities
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
644 645 646 |
# File 'lib/constantcontact/api.rb', line 644 def get_event_registrants(event) Services::EventSpotService.get_registrants(event) end |
#get_events ⇒ ResultSet<Event>
Get a list of events
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
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
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
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
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
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
814 815 816 |
# File 'lib/constantcontact/api.rb', line 814 def get_library_folders(params = {}) Services::LibraryService.get_library_folders(params) end |
#get_library_info ⇒ LibrarySummary
Retrieve MyLibrary usage information
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
790 791 792 |
# File 'lib/constantcontact/api.rb', line 790 def update_promocode(event_id, promocode) Services::EventSpotService.update_promocode(event_id, promocode) end |