We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

xml custom fields dont work when creating new customer


xml custom fields dont work when creating new customer

Having problem populating custom fields when add new customer, if you take a look at the example below custom tagsare passed as <Custom1>bla bla bla</Custom1>
<Custom2>bla bla bla</Custom2>

as a response a get 204 header and the data is populated for the customer except CUSTOM FIELDS
If you wil try to submit data in a format
<CustomField1>bla bla bla</CustomField1>
<CustomField2>bla bla bla</CustomField2>
as you would expect by seeing export you get 400 header (error) and no dat is populated, any one had problem like that? how to fixe it ?

<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text"></title>
<summary type="text">Contact</summary>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/">
<ContactList id="http://api.constantcontact.com/ws/customers/blubolt/lists/1" />

The fields you're using of Custom1, Custom2 etc. will be ignored during any PUT or POST for the Contacts collection, which is why you are not seeing these be populated. The correct field names are CustomField1, CustomField2 etc. If you are receiving a 400 error, this means that what you are attempting is a bad request. This can be caused by PUTing or POSTing your request to a bad URL or have bad XML data.


If you are receiving this error, can you provide both your XML and the URI you're PUTing to at . This way we can take a look at your data and see why the 400 is being returned.

Dave Berard
Senior Product Manager, Constant Contact

I'm getting a 400 with the following error.  The CustomField2 seems to be causing the problem, because if I remove it the operation succeeds.  What is invalid here?  Is there a 50 character limit on custom fields entered through the web API?  If I shorten the field to 50 characters, it works as well.  Note, I can enter more then 50 characters in a custom field through the UI.  Thanks in advance


<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text"> </title>
<summary type="text">Contact</summary>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/">
<FirstName>Sidney </FirstName>
<CustomField2>Palmetto Health Physician Practices-BaptistMedical Ctr</CustomField2>
<ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/davincima/lists/1" /><ContactList id="http://api.constantcontact.com/ws/customers/davincima/lists/14" /><ContactList id="http://api.constantcontact.com/ws/customers/davincima/lists/3" /></ContactLists>

Hey Brian,


You're correct, the problem is coming from a 50 character limit on those fields. This limitation is in our Contacts database, not just through API calls. While our user interface does not return an error, it does truncate the fields to 50 characters.

Nick Galbraith
Support Engineer
Developer Portal

View API documentation, code samples, get your API key.

Visit Page