I'm using Constant Contact's v2 API version and trying to add a contact by sending a request to https://api.constantcontact.com/v2/contacts. This almost always succeeds and returns a 201 response, but sometimes I get a 400 response code with the error_key = 'http.status.bad_request" and error_message = 'Bad request.' At first, I found this https://developer.constantcontact.com/api_guide/glossary_responses.html#:~:text=400%3A%20Bad%20Request,-Example%20error%20message&text=Description%3A%20Your%20request%20includes%20malformed,you%20are%20using%20is%20valid and assumed that the data we sent with the request wasn't formatted properly. After testing, I found that this was not from the JSON being malformed. I also found, by process of elimination, that the email address was the issue. When I changed the email address to something random like 'test_email_for_cc@gmail.com' then the request went through successfully, so I started looking up email validation errors for CC and found quite a few: https://community.constantcontact.com/t5/API-Developer-Support/Email-Validation/m-p/417409 https://community.constantcontact.com/t5/API-Developer-Support/v3-api-returns-Email-address-is-invalid-for-no-apparent-reason/td-p/370114 https://wordpress.org/support/topic/is-email-error-notification-message-misleading/ It sounds like my issue, as an email address didn't work one day, but did a couple weeks later when I tested it again. All those examples are using the v3 API version, so my guess is that the v2 version returns a generic error message whereas the v3 API has been improved to return a more detailed error message. So I just wanted confirmation that this is/could be the case here, because if so, then we know what to do when we see this error message and could add handling so we don't crash when we receive a 400. Or if it could be something else then that would be good to know. Thanks!
... View more