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.

Bad Request when updating a contact

Highlighted
Occasional Participant

Bad Request when updating a contact

Hi,

 

I have this code which worked fine more than a year. Now, creating of new contacts works fine, but if contacts is already registered, for some unknown reasong I receive BAD REQUEST when updating it, do you know why?

 

 

Spoiler

public static void addContact(string email, string name, string surname, string phone, string listToAdd)
{

string[] emailAddress = new string[] { email };
string nextChunkId;
IList<Contact> list = Utility.SearchContactByEmail(auth, emailAddress, out nextChunkId);
if (list.Count == 0) // If the e-mail address doesn't exist
{
// Create new Contact
Contact contact = GetContactInformation(email, name, surname, listToAdd);
Utility.CreateNewContact(auth, contact);
}
else
{
// Get his original details
Contact c1 = Utility.GetContactDetailsById(auth, list[0].Id);

// Remove him from any list he was in
// Utility.RemoveContactFromAllLists(auth, list[0].Id);

// Update His Info
c1.Name = name;
c1.LastName = surname;
c1.WorkPhone = phone;
c1.HomePhone = phone;

// And re-add him
ContactOptInList contactOptInList = new ContactOptInList();
contactOptInList.ContactList = new ContactList(listToAdd);
c1.ContactLists.Add(contactOptInList);
c1.Status = ContactStatus.Active;
c1.OptInSource = ContactOptSource.ActionByCustomer;
Utility.UpdateContactFullForm(auth, c1);
}
}

5 REPLIES 5
Highlighted
Moderator

Re: Bad Request when updating a contact

Thanks for reporting this.  It sounds very similar to a couple of other reports we are getting and we are investigating now.  If possible, can you share the detailed response you're getting so we can confirm?

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

Re: Bad Request when updating a contact

Hi Dave,

 

I have no other details apart from the error I already put in the post.

 

I'm waiting for a detailed response as soon as possible cause my application is live and any user which is already registered to a specific list, when I try to update it (add to another list using that code) it's no longer working.

Highlighted
Occasional Participant

Re: Bad Request when updating a contact

Hi Dave,

 

Any news about this? I expect from ConstantContact to investigate this asap....

Highlighted
Moderator

Re: Bad Request when updating a contact

Sorry for the long response time on this one.  It took us awhile to figure out what was going on.  Thanks to you and a couple of other developers for reporting this to us.  We got enough reports that we started to see common behaviors and that led us to figuring out the problem.

 

We found a bug in our new contact management system where duplicate phone numbers are incorrectly throwing errors.  Unfortunately, the only workaround is to not use the same phone number for both work and home.  Our contact management team is working on a fix for this but we do not have an ETA as yet.

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

Re: Bad Request when updating a contact

Thanks Dave, indeed it works if one of the phones I leave it empty.

 

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