Appearance
$io.constantContact
Server API reference.
Functions
- $io.constantContact.addContactsToList
- $io.constantContact.createContact
- $io.constantContact.execApiRequest
- $io.constantContact.followNextLink
- $io.constantContact.getCampaign
- $io.constantContact.getCampaignStats
- $io.constantContact.getContact
- $io.constantContact.getContactsInList
- $io.constantContact.listCampaignBounces
- $io.constantContact.listCampaignClicks
- $io.constantContact.listCampaigns
- $io.constantContact.listContactLists
- $io.constantContact.listContacts
- $io.constantContact.removeContactFromList
- $io.constantContact.searchContacts
- $io.constantContact.updateContact
$io.constantContact.addContactsToList
Bulk-add contacts to one or more Constant Contact lists via the activities API.
Usage
js
$io.constantContact.addContactsToList(connectionName, listIds, source, options, customRequestProperties)Description
Creates a bulk activity using POST /v3/activities/add_list_memberships to add contacts to one or more destination lists.
listIds: One list_id or an array of list_ids (destination).source: Exactly one of the following keys must be provided (mutually exclusive):{ contact_ids: Array<String> }— add specific contacts (up to API limits).{ list_ids: Array<String> }— add all contacts from these source lists.{ all_active_contacts: true }— add all active contacts in the account.{ segment_id: String }— add contacts from a saved segment.{ tag_ids: Array<String> }— add contacts that have any of these tags.
options.exclude(optional):{ contact_ids: Array<String> }to exclude specific contacts from being added.
The endpoint is asynchronous and returns an activity object. You can poll GET /v3/activities/{activity_id} to monitor progress.
Usage Scenarios
- Build audiences by adding known contacts to a marketing list
- Migrate members from one list to another
- Programmatically assemble segments (by tags, segments, or explicit IDs)
Parameters
connectionName
Type: String
Required: Yes
The Constant Contact connection/profile name to use for authentication.
listIds
Type: String | Array<String>
Required: Yes
Destination list_id or array of list_ids.
source
Type: Object
Required: Yes
Exactly one of: { contact_ids }, { list_ids }, { all_active_contacts: true }, { segment_id }, or { tag_ids }.
options
Type: Object
Required: No
Optional modifiers such as { exclude: { contact_ids: [...] } }.
customRequestProperties
Type: Object
Required: No
Advanced axios options (custom headers, timeout overrides, etc.).
Output
Type: Promise
Resolves to an object with:\n- status: true if successful\n- data: Activity object returned by Constant Contact (contains activity_id, state, timestamps)\n- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.removeContactFromList$io.constantContact.listContactLists$io.constantContact.getContactsInList$io.constantContact.searchContacts
$io.constantContact.createContact
Create a new contact in Constant Contact.
Usage
js
$io.constantContact.createContact(connectionName, email, fields)Description
Creates a new contact record in Constant Contact.
The email parameter is mandatory. Additional details such as first_name, last_name, list_memberships, and others can be supplied via the fields object.
The function automatically supplies a default create_source of "Account" if none is specified. Callers can override this by including create_source in the fields object (allowed values: "Account" or "Contact").
Usage Scenarios
- Add a new lead to a mailing list
- Capture user signup from a web form
- Programmatically grow your contact database
Parameters
connectionName
Type: String
Required: Yes
The name of the Constant Contact connection configured in the ioLoop app.
email
Type: String
Required: Yes
The email address of the contact. This is required.
fields
Type: Object
Required: No
An object with additional contact properties such as first_name, last_name, job_title, company_name, list_memberships (array of list IDs), etc. Defaults create_source to 'Account' if not specified.
Output
Type: Promise
Returns a Promise resolving to an object with:
- status: true if successful
- data: Newly created contact record as returned by Constant Contact
- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.updateContact$io.constantContact.getContact$io.constantContact.listContacts
$io.constantContact.execApiRequest
Execute a raw Constant Contact API request with OAuth2 authentication.
Usage
js
$io.constantContact.execApiRequest(connectionName, path, method, data, queryParams, customRequestProperties)Description
This function provides a generic way to invoke any Constant Contact v3 API endpoint using the configured OAuth2 connection.
It automatically attaches the correct Authorization header using the stored token, and executes the request. The function is not limited to specific resources — it can be used for contacts, campaigns, lists, reports, and more.
Supports passing in request body data for POST/PATCH requests, query parameters for GET requests, and additional custom request properties (e.g., headers or timeout overrides).
Usage Scenarios
- Call any Constant Contact API endpoint not yet wrapped by a helper function
- Experiment with new or less commonly used endpoints
- Build custom queries with query parameters and headers
Parameters
connectionName
Type: String
Required: Yes
The name of the Constant Contact connection configured in the ioLoop app.
path
Type: String
Required: Yes
API path to call (e.g., '/v3/contacts'). Can include subresources and query parameters if needed.
method
Type: String
Required: Yes
HTTP method to use (e.g., 'GET', 'POST', 'PATCH', 'DELETE').
data
Type: Object
Required: No
Request body data for POST/PATCH calls. Omit or pass null for GET/DELETE requests.
queryParams
Type: Object
Required: No
Query parameters as key/value pairs for the request URL. Omit or pass null if not needed.
customRequestProperties
Type: Object
Required: No
Optional advanced request options such as headers or timeout overrides.
Output
Type: Promise
Returns a Promise resolving to an object with:
- status: true if successful
- data: Parsed JSON response from the Constant Contact API
- err: Error message if failed
$io.constantContact.followNextLink
Follow a Constant Contact pagination link (absolute or relative) and return the next page.
Usage
js
$io.constantContact.followNextLink(connectionName, href, customRequestProperties)Description
Follows a pagination URL (typically links.next.href) returned by Constant Contact v3 APIs.
Behavior:
- Accepts either absolute URLs (starting with
http://orhttps://) or relative paths (e.g.,/v3/contacts?next=...). Relative links are resolved againsthttps://api.cc.email. - Extracts the pathname and query parameters from the URL and performs a
GETviaexecApiRequest. - If duplicate query keys exist, keeps the last occurrence (matches CC behavior for tokens like
next). - Returns the raw page from the API; use recursively to iterate all pages.
Typical usage:
- Call a list/report endpoint.
- If the response contains
links.next.href, pass that URL to this function. - Repeat until no next link remains.
Usage Scenarios
- Paginate through long result sets (contacts, lists, reports)
- Iteratively fetch all opens/clicks/bounces pages for a campaign activity
- Build import/export jobs that consume every page from CC v3 endpoints
Parameters
connectionName
Type: String
Required: Yes
The name of the Constant Contact connection configured in the ioLoop app.
href
Type: String
Required: Yes
The pagination URL to follow (may be absolute or relative, e.g., the value of links.next.href from a prior response).
customRequestProperties
Type: Object
Required: No
Optional advanced request options (headers, timeouts, etc.) passed through to API calls.
Output
Type: Promise
Resolves to an object with:\n- status: true if successful\n- data: The next page of results from Constant Contact\n- err: Error message if failed (invalid URL, network/API error)
Related Functions
$io.constantContact.execApiRequest$io.constantContact.listContacts$io.constantContact.searchContacts$io.constantContact.listCampaignOpens$io.constantContact.listCampaignClicks$io.constantContact.listCampaignBounces$io.constantContact.getCampaignStats
$io.constantContact.getCampaign
Retrieve full details for a single email campaign by ID.
Usage
js
$io.constantContact.getCampaign(connectionName, campaignId, customRequestProperties)Description
Retrieves detailed information for a single campaign via GET /v3/emails/{campaign_id}.
Compared with listCampaigns (summary view), this endpoint can include richer fields such as:
- full campaign settings (from/reply info, tracking options, etc.)
- content/preview-related fields (e.g., permalink URL, HTML content where applicable)
- associated campaign activities (IDs for sends/steps)
- additional metadata not present in the list response
Usage Scenarios
- Load a campaign to preview or inspect its full configuration
- Fetch campaign content and activities before duplication or edits
- Show campaign metadata beyond the summaries returned by listCampaigns
Parameters
connectionName
Type: String
Required: Yes
The Constant Contact connection/profile name to use for authentication.
campaignId
Type: String
Required: Yes
The unique campaign identifier to retrieve.
customRequestProperties
Type: Object
Required: No
Advanced axios options (custom headers, timeout overrides, etc.).
Output
Type: Promise
Resolves to an object with:\n- status: true if successful\n- data: Full campaign record returned by Constant Contact\n- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.listCampaigns$io.constantContact.getCampaignStats$io.constantContact.followNextLink
$io.constantContact.getCampaignStats
Fetch aggregate performance metrics (sends, opens, clicks, bounces, unsubscribes, etc.) for one or more email campaigns.
Usage
js
$io.constantContact.getCampaignStats(connectionName, campaignIds, customRequestProperties)Description
Retrieves campaign-level aggregate metrics via GET /v3/reports/stats/email_campaigns/{campaign_ids}.
campaignIdscan be a single campaign ID (String) or an Array of IDs. When multiple IDs are provided, they are sent comma-separated in the path, and the API returns an array of stats objects.- Metrics typically include: sends, delivered, bounces, unique_opens, all_opens, open_rate, unique_clicks, all_clicks, click_rate, unsubscribes, spam_reports, and other delivery/engagement counts (fields may vary by account/features).
Use this for rollups and dashboards. For recipient-level event streams (who opened/clicked/bounced), use specialized list methods (e.g., listCampaignOpens/Clicks/Bounces).
Usage Scenarios
- Display KPIs for a selected campaign
- Compare performance across multiple campaigns
- Power dashboards and reporting exports
Parameters
connectionName
Type: String
Required: Yes
The Constant Contact connection/profile name to use for authentication.
campaignIds
Type: String | Array<String>
Required: Yes
A single campaign ID or an array of campaign IDs to retrieve stats for.
customRequestProperties
Type: Object
Required: No
Advanced axios options (custom headers, timeout overrides, etc.).
Output
Type: Promise
Resolves to an object with:\n- status: true if successful\n- data: A stats object (single ID) or an array of stats objects (multiple IDs)\n- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.listCampaigns$io.constantContact.getCampaign$io.constantContact.followNextLink
$io.constantContact.getContact
Retrieve details for a single contact by ID.
Usage
js
$io.constantContact.getContact(connectionName, contactId, customRequestProperties)Description
This function retrieves the details of a single contact from Constant Contact using the v3 API.
You must provide a valid contactId obtained from listing or searching contacts. The response includes profile information, list memberships, and metadata for the specified contact.
Usage Scenarios
- Look up a specific contact’s profile information
- Fetch details to display or edit in a CRM UI
- Verify if a contact already exists in Constant Contact before updating
Parameters
connectionName
Type: String
Required: Yes
The name of the Constant Contact connection configured in the ioLoop app.
contactId
Type: String
Required: Yes
The unique identifier of the contact to retrieve.
customRequestProperties
Type: Object
Required: No
Optional advanced request options such as headers or timeout overrides.
Output
Type: Promise
Returns a Promise resolving to an object with:
- status: true if successful
- data: Contact object with fields like id, email_address, first_name, last_name, list memberships, etc.
- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.listContacts$io.constantContact.createContact$io.constantContact.updateContact$io.constantContact.searchContacts
$io.constantContact.getContactsInList
Retrieve contacts that belong to one or more Constant Contact lists.
Usage
js
$io.constantContact.getContactsInList(connectionName, listId, limit, cursor, status, include, customRequestProperties)Description
Fetches contacts using Constant Contact's GET /v3/contacts with the lists filter.
listIdmay be a single list ID (string) or an array of IDs. When multiple IDs are provided, the filter is OR (contacts in any of the specified lists).limitcontrols page size. The pagination link at_links.next.hrefcan be provided to$io.constantContact.followNextLinkfor retriving the next page.- Optional
statusfilters the contacts returned (e.g., 'active', 'deleted', 'unsubscribed', or 'all'). includecan inline subresources such aslist_memberships,custom_fields,taggings,notes,phone_numbers,street_addresses(comma-separated or array).
Usage Scenarios
- Show all members of a selected audience list
- Export list members with pagination
- Build segments by fetching contacts from multiple lists
Parameters
connectionName
Type: String
Required: Yes
The Constant Contact connection/profile name to use for authentication.
listId
Type: String | Array<String>
Required: Yes
One list ID or an array of list IDs. Multiple IDs are combined with OR semantics.
limit
Type: Number
Required: No
Maximum number of contacts to return per page (default 50).
status
Type: String
Required: No
Contact status filter: 'active' | 'deleted' | 'unsubscribed' | 'all'.
include
Type: String | Array<String>
Required: No
Subresources to inline, e.g., ['list_memberships','custom_fields'].
customRequestProperties
Type: Object
Required: No
Advanced axios options (custom headers, timeout overrides, etc.).
Output
Type: Promise
Resolves to an object with:\n- status: true if successful\n- data: Raw API response (contacts array, and possibly _links.next.href)\n- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.listContactLists$io.constantContact.searchContacts$io.constantContact.followNextLink
$io.constantContact.listCampaignBounces
List bounce events for an email campaign activity, optionally filtered by bounce code.
Usage
js
$io.constantContact.listCampaignBounces(connectionName, campaignActivityId, limit, bounceCode, customRequestProperties)Description
Retrieves bounce tracking events for a specific email campaign activity via GET /v3/reports/email_reports/{campaign_activity_id}/tracking/bounces.
Parameters:
limitcontrols page size (implementation defaults to 500).bounceCode(optional) filters by Constant Contact bounce code.
Bounce codes:
- B – Non-existent / Undeliverable (invalid address, hard bounce)
- D – Undeliverable (other non-permanent delivery failure, e.g. DNS/routing issue)
- F – Full mailbox (soft bounce)
- S – Suspended (address suppressed after repeated bounces; CC won’t deliver again)
- V – Vacation / Auto-reply (out-of-office)
- X – Other / General (unknown or transient error)
- Z – Blocked (server blocked delivery, e.g. spam filter/firewall)
Pagination:
- Use the
links.next.hrefvalue from the response with$io.constantContact.followNextLinkto fetch subsequent pages.
Each result item includes bounce details such as contact_id, email_address, bounce_code, bounce_description, and event timestamp, along with any metadata provided by Constant Contact.
Usage Scenarios
- Identify contacts whose emails bounced for a given campaign
- Segment contacts by bounce reason (e.g., soft vs hard)
- Export bounce data for suppression or cleanup workflows
Parameters
connectionName
Type: String
Required: Yes
The name of the Constant Contact connection configured in the ioLoop app.
campaignActivityId
Type: String
Required: Yes
The Constant Contact campaign activity ID to retrieve bounce events for.
limit
Type: Number
Required: No
Maximum number of records to return per page. Default is 500.
bounceCode
Type: String
Required: No
Optional Constant Contact bounce code to filter results (B, D, F, S, V, X, Z). See description for meanings.
customRequestProperties
Type: Object
Required: No
Optional advanced request options (headers, timeouts, etc.) passed through to API calls.
Output
Type: Promise
Returns a Promise resolving to an object with:\n- status: true if successful\n- data: API response containing bounce events and pagination links\n- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.followNextLink$io.constantContact.listCampaignOpens$io.constantContact.listCampaignClicks$io.constantContact.getCampaignStats
$io.constantContact.listCampaignClicks
List click events for an email campaign activity, optionally filtered by a specific URL (url_id).
Usage
js
$io.constantContact.listCampaignClicks(connectionName, campaignActivityId, limit, urlId, customRequestProperties)Description
Retrieves click tracking events for a specific email campaign activity using GET /v3/reports/email_reports/{campaign_activity_id}/tracking/clicks.
Query parameters:
limitcontrols page size (the implementation defaults to 500 if not provided).url_id(optional) filters events to clicks on a single tracked URL within the activity.
Pagination:
- The Constant Contact API returns pagination links; use
links.next.hrefwith$io.constantContact.followNextLinkto fetch subsequent pages.
Each result item typically includes identifiers and event details (e.g., contact_id, email_address, url_id, click_date/timestamp, and other metadata provided by Constant Contact).
Usage Scenarios
- Analyze which contacts clicked a particular link in a campaign
- Build click-through reports and engagement dashboards
- Page through click events to export or sync into a data warehouse
Parameters
connectionName
Type: String
Required: Yes
The name of the Constant Contact connection configured in the ioLoop app.
campaignActivityId
Type: String
Required: Yes
The Constant Contact campaign activity ID to retrieve click events for.
limit
Type: Number
Required: No
Maximum number of records to return per page. Default is 500.
urlId
Type: String
Required: No
Optional tracked URL ID to filter clicks to a specific link.
customRequestProperties
Type: Object
Required: No
Optional advanced request options (headers, timeouts, etc.) passed through to API calls.
Output
Type: Promise
Returns a Promise resolving to an object with:\n- status: true if successful\n- data: API response containing click events and pagination links\n- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.listCampaignOpens$io.constantContact.getCampaign$io.constantContact.getCampaignStats
$io.constantContact.listCampaigns
List email campaigns with optional status filter, sorting, and pagination.
Usage
js
$io.constantContact.listCampaigns(connectionName, limit, cursor, status, sort, customRequestProperties)Description
Retrieves email campaigns via GET /v3/emails.
limitcontrols page size. The pagination link at_links.next.hrefcan be provided to$io.constantContact.followNextLinkfor retriving the next page.statuscan filter campaigns (e.g., 'DRAFT', 'SCHEDULED', 'RUNNING', 'DONE', 'ERROR').sortcontrols ordering (e.g., 'created_at desc', 'modified_at asc').
Usage Scenarios
- Build a campaigns table with paging and sorting
- Filter to drafts or completed campaigns
- Select a campaign before inspecting activities or stats
Parameters
connectionName
Type: String
Required: Yes
The Constant Contact connection/profile name to use for authentication.
limit
Type: Number
Required: No
Maximum number of campaigns to return (default 50, max 500).
status
Type: String
Required: No
Filter by campaign status (e.g., 'DRAFT', 'SCHEDULED', 'RUNNING', 'DONE', 'ERROR').
sort
Type: String
Required: No
Sort expression, e.g., 'created_at desc' or 'modified_at asc'.
customRequestProperties
Type: Object
Required: No
Advanced axios options (custom headers, timeout overrides, etc.).
Output
Type: Promise
Resolves to an object with:\n- status: true if successful\n- data: Raw API response (campaigns array and possibly _links.next.href)\n- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.getCampaign$io.constantContact.getCampaignStats$io.constantContact.followNextLink
$io.constantContact.listContactLists
List Constant Contact lists (e.g., 'Newsletter Subscribers'), with optional filters and counts.
Usage
js
$io.constantContact.listContactLists(connectionName, limit, includeMembershipCount, status, name, includeCount, customRequestProperties)Description
Retrieves contact lists from Constant Contact via GET /v3/contact_lists.
Parameters map to the documented query options:
limit(Number): Max lists to return (1–1000). Defaults to 1000 if omitted by the API.includeMembershipCount(String | null): If set, include member counts: 'all' (all contacts) or 'active' (active contacts only).status(String | null): List status filter (applies to lists themselves, not members): 'active', 'deleted', 'all', or a comma-separated combination (e.g., 'active,deleted').name(String | null): Exact list name match.includeCount(Boolean): If true, adds an overalllists_countto the response.
Pagination: when the response includes _links.next.href, call $io.constantContact.followNextLink(connectionName, href) to fetch the next page.
Usage Scenarios
- Display all available contact lists for selection
- Filter to only active or deleted lists
- Show membership counts to help pick the right audience
Parameters
connectionName
Type: String
Required: Yes
The Constant Contact connection/profile name to use for authentication.
limit
Type: Number
Required: No
Maximum number of lists to retrieve (1–1000).
includeMembershipCount
Type: String
Required: No
Include member counts for each list. Allowed: 'all' or 'active'.
status
Type: String
Required: No
Filter by list status: 'active' | 'deleted' | 'all' | comma-separated.
name
Type: String
Required: No
Exact list name to match.
includeCount
Type: Boolean
Required: No
If true, includes an overall lists_count in the response.
customRequestProperties
Type: Object
Required: No
Advanced axios options (custom headers, timeout overrides, etc.).
Output
Type: Promise
Resolves to an object with:
- status: true if successful
- data: Raw API response including list objects and possibly _links.next.href
- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.searchContacts$io.constantContact.getContact$io.constantContact.followNextLink
$io.constantContact.listContacts
Retrieve a paginated list of contacts from Constant Contact.
Usage
js
$io.constantContact.listContacts(connectionName, limit, next, extraQuery, customRequestProperties)Description
This function retrieves a list of contacts from Constant Contact using the v3 API.
limit controls page size. The pagination link at _links.next.href can be provided to $io.constantContact.followNextLink for retriving the next page. You may also provide additional query parameters (such as filters) through extraQuery.
The response includes contacts with their basic profile fields and metadata.
Usage Scenarios
- Browse all contacts in your Constant Contact account
- Build a list view of contacts with pagination support
- Export or sync contacts into another system
Parameters
connectionName
Type: String
Required: Yes
The name of the Constant Contact connection configured in the ioLoop app.
limit
Type: Number
Required: No
Maximum number of contacts to retrieve per call. Default is 50.
extraQuery
Type: Object
Required: No
Additional query parameters as key/value pairs (e.g., { status: 'active' }).
customRequestProperties
Type: Object
Required: No
Optional advanced request options such as headers or timeout overrides.
Output
Type: Promise
Returns a Promise resolving to an object with:
- status: true if successful
- data:
- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.getContact$io.constantContact.createContact$io.constantContact.updateContact$io.constantContact.searchContacts$io.constantContact.followNextLink
$io.constantContact.removeContactFromList
Bulk-remove contacts from one or more lists via the activities API.
Usage
js
$io.constantContact.removeContactFromList(connectionName, listIds, source, options, customRequestProperties)Description
Creates an asynchronous bulk activity using POST /v3/activities/remove_list_memberships to remove contacts from one or more destination lists.
listIds: One list_id or an array of list_ids (destinations to remove from).source: Exactly one selector must be provided (mutually exclusive):{ contact_ids: Array<String> }— remove these specific contacts.{ list_ids: Array<String> }— remove all contacts currently in these source lists from the destination list(s).{ all_active_contacts: true }— remove all active contacts from the destination list(s).{ segment_id: String }— remove contacts that match this saved segment.{ tag_ids: Array<String> }— remove contacts that have any of these tags.
The endpoint returns an activity object; poll GET /v3/activities/{activity_id} to monitor progress and results.
Usage Scenarios
- Clean up list memberships before a campaign
- Remove contacts with a specific tag from a list
- Mirror audience changes from an external system
Parameters
connectionName
Type: String
Required: Yes
The Constant Contact connection/profile name to use for authentication.
listIds
Type: String | Array<String>
Required: Yes
Destination list_id or array of list_ids from which contacts will be removed.
source
Type: Object
Required: Yes
Exactly one of: { contact_ids }, { list_ids }, { all_active_contacts: true }, { segment_id }, or { tag_ids }.
options
Type: Object
Required: No
Reserved for parity with addContactsToList (currently unused).
customRequestProperties
Type: Object
Required: No
Advanced axios options (custom headers, timeout overrides, etc.).
Output
Type: Promise
Resolves to an object with:\n- status: true if successful\n- data: Activity object returned by Constant Contact (e.g., activity_id, state, timestamps)\n- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.addContactsToList$io.constantContact.listContactLists$io.constantContact.getContactsInList$io.constantContact.searchContacts
$io.constantContact.searchContacts
Search contacts using documented query parameters (email, lists, tags, status, date ranges, etc.).
Usage
js
$io.constantContact.searchContacts(connectionName, criteria, limit, cursor, include, customRequestProperties)Description
Executes a search against Constant Contact's GET /v3/contacts endpoint using documented query parameters.
criteria supports the following keys (all optional):
email(String) — exact matchlists(String | Array<String>) — list ID or comma-separated list IDstag_id(String) — tag IDsegment_id(String) — segment IDstatus(String) — e.g., 'active', 'deleted', 'unsubscribed'order_by(String) — e.g., 'email_address', '-updated_at'- Date/time filters (ISO 8601 required):
updated_after,updated_before,created_after,created_before,optout_after,optout_before
limit controls page size. The pagination link at _links.next.href can be provided to $io.constantContact.followNextLink for retriving the next page.
include can inline subresources (comma-separated or array): custom_fields, list_memberships, taggings, notes, phone_numbers, street_addresses.
Date formats: Pass ISO 8601 strings (e.g., 2025-08-22T18:30:00Z). If you have Unix timestamps, convert to ISO first.
Usage Scenarios
- Find a contact by email or list/tag membership
- Filter contacts by status or date ranges
- Build paginated contact queries for exports and syncs
Parameters
connectionName
Type: String
Required: Yes
The Constant Contact connection/profile name to use for authentication.
criteria
Type: Object
Required: No
Key/value filters (email, lists, tag_id, segment_id, status, order_by, and ISO 8601 date filters like updated_after).
limit
Type: Number
Required: No
Max results per page. Default is 50.
include
Type: String | Array<String>
Required: No
Subresources to inline in the response (e.g., ['list_memberships','custom_fields']).
customRequestProperties
Type: Object
Required: No
Advanced axios options (custom headers, timeout overrides, etc.).
Output
Type: Promise
Resolves to an object with:
- status: true if successful
- data: Raw API response (including results and possibly _links.next.href)
- err: Error message if failed
Related Functions
$io.constantContact.execApiRequest$io.constantContact.listContacts$io.constantContact.getContact$io.constantContact.createContact$io.constantContact.updateContact$io.constantContact.followNextLink
$io.constantContact.updateContact
Update an existing Constant Contact record by fetching the current contact, merging your changes, and sending a PUT.
Usage
js
$io.constantContact.updateContact(connectionName, contactId, fields)Description
Updates an existing contact using Constant Contact's PUT /v3/contacts/{contactId} (replace) endpoint.
Because PUT replaces the resource, this function first fetches the current contact (GET /v3/contacts/{contactId}), merges your fields into it, and then issues a PUT with the merged object. This prevents accidental clearing of properties you didn't specify.
Merge behavior:
- Top-level shallow merge: properties in
fieldsoverwrite the same top-level properties from the existing contact. - Nested objects/arrays: if you provide a nested object or array (e.g.
email_address,phone_numbers,street_addresses,list_memberships), it replaces that nested value in full. If you omit it, the existing value is preserved. - To remove a field, explicitly set it to
nullor an empty array as appropriate per Constant Contact's rules.
Notes:
- You must pass a valid
contactId. - Include only the properties you wish to change; unspecified properties are preserved by the GET→merge strategy.
- If the initial GET fails (not found / auth / etc.), the function returns that error and does not attempt the PUT.
Usage Scenarios
- Safely update a contact without wiping unspecified fields
- Modify name, phone, addresses, or list memberships
- Keep CRM contact records in sync with Constant Contact
Parameters
connectionName
Type: String
Required: Yes
The name of the Constant Contact connection configured in the ioLoop app.
contactId
Type: String
Required: Yes
The Constant Contact ID of the contact to update.
fields
Type: Object
Required: Yes
Top-level fields to update; shallow-merged into the existing contact. Nested objects/arrays you provide are replaced in full. Example: { first_name: 'John', email_address: { address: '[email protected]' }, list_memberships: ['abc123'] }.
Output
Type: Promise
Resolves to an object: \n- status: true if successful\n- data: The updated contact object returned by Constant Contact\n- err: Error message if failed (e.g., GET failed, validation error on PUT)

