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.

Valid email addresses getting rejected?

Highlighted
Occasional Participant

Valid email addresses getting rejected?

It seems like perfectly valid email addresses are being rejected when I try to add new contacts via the API:



POST https://api.constantcontact.com/ws/customers/jakobs/contacts
<entry xmlns='http://www.w3.org/2005/Atom'><id>data:,none</id><title type='text'></title><summary type='text'>Contact</summary><content type='application/vnd.ctct+xml'><Contact xmlns='http://ws.constantcontact.com/ns/1.0/'><EmailAddress>jakob_skjerning@example.com</EmailAddress><FirstName>Jakob</FirstName><OptInSource>ACTION_BY_CONTACT</OptInSource><ContactLists><ContactList id='http://api.constantcontact.com/ws/customers/jakobs/lists/1'/></ContactLists></Contact></content><updated>2010-03-13T15:27:22+01:00</updated><author/></entry>

Results in a HTTP 400 response:



Error 400: Error: Line 1: cvc-pattern-valid: Value 'jakob_skjerning@example.com' is not facet-valid with respect to pattern '(+)@(+)' for type 'emailaddressstring'.
Error: Line 1: cvc-type.3.1.3: The value 'jakob_skjerning@example.com' of element 'EmailAddress' is not valid.

Suffice to say, that regex probably needs to be looked at and would likely work better as '(.+)@(.+)' so we once again can include dashes, underscores, plusses and other valid characters in email addresses.


Thanks in advance.

Jakob Skjerning

substancelab.com - crafting quality web applications

 

8 REPLIES 8
Highlighted
New Member

Same problem here - valid email addresses rejected

I am noticing this same problem, emails with a - are not going through (email@web-address.com) that are my own personal emails that work fine with everything else.  All other emails are going through fine, was driving me crazy for a while before I realized the correlation that all emails being added that weren't working had the dash in there.  Please let me know if there is anything I can do on my end to fix the problem!

Highlighted
New Member

Same here with this message

I am getting


Error 400: Error: Line 2: cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '\s*\S(.|\n|\r)*' for type 'emailaddressstring'. Error: Line 2: cvc-type.3.1.3: The value '' of element 'EmailAddress' is not valid.


Which is a different pattern than above.


OOPS: Obviously Value '' means there was no value ... I had a mismatch between my form variable in the form vs. script.  Never mind me ....

Highlighted
Moderator

Thank you for the feedback. 

Thank you for the feedback.  We are looking into this issue and hope to have an update soon regarding it. 

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Established Member

Re: Thank you for the feedback.

Hi,

 

I have as well an issue with uploading valid emails.

Would you be able to provide regex you're using? It would avoid playing cat and mouse with your API and simply use what you're using.

 

Regards

Mariusz

Highlighted
Employee

Re: Thank you for the feedback.

Hi Mariusz,

 

I'm sorry, but that regex is absolutely buried in our code (and not webservices code). I've tried before, and not been able to get a clear answer as to what our regex is.

 

If you want to utilize our regular expression, the only way to do it is to submit the email address through our API (or user interface). This also looks like a decent one, if you want to try to catch it on your side first. \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b

 

I normally advise people to do a minimal check (say, validate that the string submitted to you has a minimum of 5 characters and contains an @ and period, and then submit to us. Sorry again for the limitation of not being able to tell you the exact regex we use.

 

Best Regards,
Shannon Wallace
Partner API Support Engineer

Highlighted
Established Member

Re: Thank you for the feedback.

Thank you very much Shannon.

 

I have resolved the issue by supplying only ISO8859-1 complient characters as part of json payload.
I found information about it on your website.

Taking opportunity I wanted to ask about your API again.

My task is to compare two mailing lists and remove from one of them contacts that appear on second list.
It seems quite simple task but the best solution I found so far is to request contacts of entire mailing list collections, compare them in memory and then remove contacts from a list using Bulk Activities - Remove Contacts Endpoint


I was wondering if it's possible to do it simpler way.

Thanks for help again.

Regards
Mariusz

Highlighted
Employee

Re: Thank you for the feedback.

Hi there,

 

I see what you mean. Unfortunately I believe the way you're doing this is the only way to do it. It's the same through our user interface--it's a pretty manual process to make sure contacts on one list don't appear on another list.

 

Best Regards,

Shannon Wallace

Partner API Support Engineer

Highlighted
Occasional Participant

Valid Emails are being rejected

We are having the same problem on our site -- any email with an underscore "_" is getting rejected. Please fix soon, thanks! 

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