I had a problem a few days ago where searchContactsByEmail returned about 20 records where the email address did not match the email being searched for. This unfortunately caused my code to update 20 records that should not have been updated.
Has anyone else seen this?
Sorry but No.
Contacts in CC only get updated or inserted based on Emial id.May be in your case all 20 contact email id will be same.
I have taken a bit of time to look into this, and that function should return all contact that have the email address that you provided. It is possible that it may have returned a set of contacts who appear to have different email addresses if the extra contacts have multiple email addresses that includes the address that you searched for.
The other potential thing to consider is that the function will accept a string or an array as input. If an array is input, then it will search for every email address in the array.
Given the information above, I would suggest checking if any of the contacts that appears to be returned in error have multiple email addresses in the Constant Contact UI. I would also double-check to ensure that your code is sending a single string as a search parameter and not an array.
If you find that neither of these is the case, we can likely provide further assistance if you send us an email with greater detail of how this is being used and an example of the email address that came up wrong at email@example.com.