The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

xml custom fields dont work when creating new customer

Highlighted
New Member

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>
<updated>2009-04-23T04:49:18.000000Z</updated>
<author></author>
<id>http://api.constantcontact.com/ws/customers/www.blablabla.com/contacts/66666</id>
<summary type="text">Contact</summary>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/">
<EmailAddress>krzych@blablabla.com</EmailAddress>
<EmailType>HTML</EmailType>
<FirstName>Krzych</FirstName>
<LastName>Jay</LastName>
<Custom1></Custom1>
<Custom2>competition</Custom2>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/blubolt/lists/1" />
</ContactLists>
</Contact>
</content>
</entry>
3 REPLIES 3
Highlighted
Moderator

RE: xml custom fields dont work when creating new customer

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
Highlighted
Frequent Visitor

Re: RE: xml custom fields dont work when creating new customer

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>
<updated>2008-07-23T14:21:06.407Z</updated>
<author></author>
<id>data:,none</id>
<summary type="text">Contact</summary>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/">
<EmailAddress>semschunter@aol.com</EmailAddress>
<OptInSource>ACTION_BY_CONTACT</OptInSource>
<FirstName>Sidney </FirstName>
<LastName>Morrison</LastName>
<PostalCode>29201</PostalCode>
<StateCode>sc</StateCode>
<CustomField1>general</CustomField1>
<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>
</Contact>
</content>
</entry>

Highlighted
Moderator

Re: RE: xml custom fields dont work when creating new customer

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

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured