Avoid 409 conflicts with the unified Contact object model: Making the right type of request
Constant Contact uses a unified Contact object model, in which lists are attributes of the Contact. As such, to modify list memberships, you modify the Contact, rather than the Interest/Mailing List, and specific contacts (by email address) are unique resources at the level of the account.
This has ramifications for creating and updating contacts, as a contact that exists in any status of list in an account must be updated (via PUT request) to be added to any other interest/mailing list, and creating a contact (via POST request) can only be done for Contacts that have never previously been added to the account, regardless of list.
An attempt to change list attributes of any contact in an account, by using a POST request, will result in a 409 Conflict response for our API, because the resource already exists in the account. In this case, adding the contact to a new list requires a PUT request to update the Interest/Mailing Lists attributes of the contact.
A workable flow for a signup form that will either add or update is therefore to first use a GET request to Search for the submitted contact by email address, then to create it if it doesn’t exist (POST), and if it does exist, then to GET the contacts details, add the new list among the existing list attributes in the contact object, then update the contact details (PUT).
You can post a new message in the Community or find us on Twitter Mon-Fri 8am-8pm ET, Sat 10am-8pm ET, & Sun 10am-6pm ET. We've got real people waiting to help you out. Click below to start a conversation!