Simply post 10 custom fields directly to CC

Regular Participant

Simply post 10 custom fields directly to CC

I've been a getresponse.com customer, and I've been using cURL through php to post 10 fields to getresponse, but I've had problems with getresponse, and I'm on a trial account here at CC. All I want to do is send 10 form fields to CC, adding them to my list of customers. I don't need anything fancy, or anything more than what I've described here. Can anyone help me go in the right direction, or does anyone have sample code that is similar to what I'm trying to do?

Thank you,
2 REPLIES 2
Regular Participant

I can successfully add a contact, but my custom fields are not being added. For instance, in the following XML $entry, I'm trying to add a custom field called "Location", which has already been added as a custom field in my list, but it's not working:

$entry = "<entry xmlns='http://www.w3.org/2005/Atom'>";
$entry .= "<title type='text'>". htmlspecialchars("Hmmm this is ignored right now") ."</title>";
$entry .= "<updated>". htmlspecialchars("2008-06-23T14:21:06.407Z") ."</updated>";
$entry .= "<author><name>". htmlspecialchars("Acme Industries") ."</name></author>";
$entry .= "<id>urn:uuid:E8553C09F4xcvxCCC53F481214230867087</id>";
$entry .= "<summary type='text'>". htmlspecialchars("Customer document") ."</summary>";
$entry .= "<content type='application/vnd.ctct+xml'>";
$entry .= " <Contact xmlns='http://ws.constantcontact.com/ns/1.0/'>";
$entry .= " <EmailAddress>". htmlspecialchars("test951@exaweff.com") ."</EmailAddress>";
$entry .= " <FirstName>". htmlspecialchars("First") ."</FirstName>";
$entry .= " <LastName>". htmlspecialchars("Last") ."</LastName>";
$entry .= " <Location>". htmlspecialchars("Murrieta") ."</Location>"; //<<This is the custom field that I want added and is not working
$entry .= " <OptInSource>". htmlspecialchars("ACTION_BY_CONTACT") ."</OptInSource>";
$entry .= " <ContactLists>";
$entry .= " <ContactList id='http://api.joesflowers.constantcontact.com/ws/customers/joesflowers/lists/2' />";
$entry .= " </ContactLists>";
$entry .= " </Contact>";
$entry .= "</content>";
$entry .= "</entry>";

Regular Participant

Please use CustomField1, CustomField2... and so on in the xml tags instead of values like "Location" in other word your entry should be....


$entry = "<entry xmlns='http://www.w3.org/2005/Atom'>";
$entry .= "<title type='text'>". htmlspecialchars("Hmmm this is ignored right now") ."</title>";
$entry .= "<updated>". htmlspecialchars("2008-06-23T14:21:06.407Z") ."</updated>";
$entry .= "<author><name>". htmlspecialchars("Acme Industries") ."</name></author>";
$entry .= "<id>urn:uuid:E8553C09F4xcvxCCC53F481214230867087</id>";
$entry .= "<summary type='text'>". htmlspecialchars("Customer document") ."</summary>";
$entry .= "<content type='application/vnd.ctct+xml'>";
$entry .= " <Contact xmlns='http://ws.constantcontact.com/ns/1.0/'>";
$entry .= " <EmailAddress>". htmlspecialchars("test951@exaweff.com") ."</EmailAddress>";
$entry .= " <FirstName>". htmlspecialchars("First") ."</FirstName>";
$entry .= " <LastName>". htmlspecialchars("Last") ."</LastName>";
$entry .= " <CustomField1>". htmlspecialchars("Murrieta") ."</CustomField1>"; //<<This is the custom field that I want added and is not working
$entry .= " <OptInSource>". htmlspecialchars("ACTION_BY_CONTACT") ."</OptInSource>";
$entry .= " <ContactLists>";
$entry .= " <ContactList id='http://api.joesflowers.constantcontact.com/ws/customers/joesflowers/lists/2' />";
$entry .= " </ContactLists>";
$entry .= " </Contact>";
$entry .= "</content>";
$entry .= "</entry>";
Developer Portal

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

Visit Page