Class: ConstantContact::Api
- Inherits:
-
Object
- Object
- ConstantContact::Api
- Defined in:
- lib/constantcontact/api.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
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
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_token ⇒ Object
Returns the value of attribute access_token
10 11 12 |
# File 'lib/constantcontact/api.rb', line 10 def access_token @access_token end |
#api_key ⇒ Object
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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_trash ⇒ Boolean
Permanently deletes all files in the Trash folder
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
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_info ⇒ AccountInfo
Get a summary of account information
41 42 43 |
# File 'lib/constantcontact/api.rb', line 41 def get_account_info() @account_service.get_account_info() end |
#get_activities(params = {}) ⇒ Array<Activity>
Get an array of activities
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
658 659 660 |
# File 'lib/constantcontact/api.rb', line 658 def get_event_registrants(event) @event_spot_service.get_registrants(event) end |
#get_events ⇒ ResultSet<Event>
Get a list of events
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
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
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
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
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
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
828 829 830 |
# File 'lib/constantcontact/api.rb', line 828 def get_library_folders(params = {}) @library_service.get_library_folders(params) end |
#get_library_info ⇒ LibrarySummary
Retrieve MyLibrary usage information
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |