updateContact documentation

Highlighted
Occasional Contributor

updateContact documentation

Hi -

 

I'm trying to get updateContact to work and have had some problems. At some point I even ended up with the contact being marked Removed.

 

My code:

 

$contactsFound = array();

if ($oldClientVO != null && ($contactsFound = $constantContact->searchContactsByEmail($oldClientVO->getEmail()))) {
foreach ($contactsFound as $onlineContact) {
$onlineContact->emailAddress = $clientVO->getEmail();
if (!$constantContact->updateContact($onlineContact)) {
Zend_Registry::get('logger')->log("Error saving constant contact entry.", Zend_Log::ERR);
}
}
} else {

// add contact
}

 

Thanks!

Dave

4 REPLIES 4
Highlighted
Occasional Contributor

Re: updateContact documentation

I found another post that answered the question. Even though I searched a contact I found that I still need to reset the list(s) the contact belongs to. Strange a searc h did not return that.

 

Dave

Highlighted
Moderator

Re: updateContact documentation

Sorry for the confusion.  Search contact returns a subset of the Contact information, which does not include the lists that they are on.  In order to get their current lists, you would need to retrieve the full Contact information if you found that the Contact did exist.

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Contributor

Re: updateContact documentation

Thanks for the reply.

 

Would I call getContactDetails() for that. If so, what is the key for that method?

 

Dave

Highlighted
Trusted Contributor

Re: updateContact documentation

Hi Dave,

 

When you use the searchContacts functions, you get an array of contact objects. These contain identifiers.  You use them to call getContactDetails($contactOjbect), which should return an object with full contact details. You modify the contact lists in this object, and then pass it to the updateContact() function.

 

That should be a workable flow for you.

 

Mark Coleman
Support Engineer
Developer Portal

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

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured