I'd like to use your service for tracking emails from a facebook application. Facebook uses a complex email proxy system, one that protects the privacy of its users. The resulting email is odd, but real and valid. Using these emails in the API produces a 400 error, "Invalid email"
Here's the XML I sent via ATOM:
<title type="text"> </title>
<ContactList id="https://api.constantcontact.com/ws/customers/nhp_bbym/lists/1" />
The servers then said
Error 400: The provided email address
was not valid
Can you help? Is there a way to go around your filters?
You need to html encode the + sign in the email address I think.
James Benson, PHP Developer.
Constant Contact Services: http://integrationservic.es/
I had a + email address fail as well. Why would I have to URL encode this in the PHP SDK? It should handle that fine through the JSON serialization. Trying to port my system over to Constant Contact, but your email validation rules are overly strict.
I did some testing against the API directly and was able to add both a .us email address and an email address with a + sign in it (not encoded in any way). If you're recieving errors, it is highly likely it could be a bug in the PHP SDK. Is there any way you can capture the JSON that is being created and share that with us either in a PM or via email?
We do not have any restrictions on those characters in our contact validation though so it definitely sounds like a formatting or transport error.
It should be noted we do not support email addresses over 80 characters in length, that is total including both the domain, local address and @ sign. The address you are specifying is 83 characters in total so it will not be supported.
The API also rejects short emails like: email@example.com. This is understandable. However, I have 2 questions:
Question you asked is a really good one. While we don't have documentation anywhere on the validation, I did go into our validation code to pull out all of our rules to get you your answer. I'm going to update our API documentation to reflect this information as well to help future developers. Let me know if you have any qusetions.
Minimum Length = 6 characters total, including @ and . characters
Maximum Length = 80 characters total, including @ and . characters
Local Name Limitations:
Quoted local names can have all ASCII characters, including backspace escaped quotes (\"), from the ASCII character table with values lower than 126 except for all control characters
Unquoted local names can have all ASCII characters from the ASCII character table with values lower than 126 except for: all control characters, space, angle brackets, parentheses, square brackets, comma, colon, semicolon, backslash, double quote and ampersand
Domain Name Limitations:
The only valid characters for domain name are: a-z, A-Z, 0-9 and -
Domain Name can have sub-domains (subdomain.domain.com), consecutive . are considered invalid as a domain names must consist of at least 1 character
IP addresses are not a valid domain name for email addresses in our system
If an email address passes all of these validation rules, we consider it a valid email address. Hope this helps.