cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

Avoid 409 conflicts with the unified Contact object model: Making the right type of request

Highlighted
Trusted Contributor

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).

Mark Coleman
Support Engineer