Hello John,
Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.
Once a contact (email address) has been added into the system, even if it is deleted, the contact entry and details still remain on the back end of the system for reporting and compliance purposes. When using the API, there are a couple of different endpoint options to bypass the 409 response. Typically this error occurs when making a POST call to the /contacts endpoint, which can only add new contacts whose email addresses have not previously been added to the account.
For example, if a contact unsubscribes from your organization’s mailing list, and you were to delete and then re-add that contact, they would be re-added as unsubscribed rather than as a new contact. This allows us to be compliant with the CAN-SPAM Act, as well as other applicable laws and regulations.
CAN-SPAM Act and how it affects your campaigns
https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5825-can-spam-act-and-how-it-affects-your-campaigns
Frequently Asked Questions for Contacts
https://www.constantcontact.com/legal/about-constant-contact-faqs
Essentially, deleting a contact never really deletes them. It just strips their list memberships, moves them into a “deleted” status, and hides them from being visible in the account.
It looks like you may be using our V2 legacy API. You can use this flow to add/update your contacts which incorporates three contact endpoints:
Step 1: Check to see if the contact exists in the account using the email query parameter to search for a contact using a specific email address.
(GET) contacts in the user's account
https://v2.developer.constantcontact.com/docs/contacts-api/contacts-collection.html?method=GET
Step 2: If the contact comes back as non-existent, use POST to create the contact:
(POST) to create a new contact
https://v2.developer.constantcontact.com/docs/contacts-api/contacts-collection.html?method=POST
Step 3: If the contact comes back as already existing in the account. You need to append the returned data with the desired list memberships and send that back with PUT to update the contact:
*When Updating a contact, we need to append the new information to the old information and send all of it back in the request, because when you update a contact using a PUT, all properties are updated, overwriting all existing property values. Any properties left blank or not included in the PUT will be overwritten with a null value.
(PUT) to update a contact
https://v2.developer.constantcontact.com/docs/contacts-api/contacts-resource.html?method=PUT
If you decide to migrate to our current V3 API in the future, you can still use the solution mentioned above for V2, but we also have other solutions available for V3 that may better meet your needs:
Option 1:
Use the sign-up form endpoint, to add a new contact to an account or update an existing contact based on their email address. Only use this method when a contact gives you their explicit permission to send them emails.
Create or Update a Contact Using a Single Method (less recommended)
https://v3.developer.constantcontact.com/api_guide/contacts_create_or_update.html
Option 2:
You can use our bulk activity endpoints to import new contacts and update existing contacts when syncing local data with Constant Contact. These endpoints use the email addresses you provide in the import to determine if each contact is new or not. When you import an existing contact, these endpoints only update the contact properties you include in the import request.
Import Contacts Using Bulk Activity Endpoints
https://v3.developer.constantcontact.com/api_guide/import_contacts.html
Please have a look and let us know if you have any other questions!
... View more