There's no shortage of the 400 errors others have had that I see on the forum, but I'm using the sanctioned python Constant Contact API ( http://www.ctctlabs.com/index.php/blog/detail/ctct_web_services_python_client_library/ ) and still having problems. Below is the (mostly) verbatim XML I'm using to create a new user:
Solved! Go to Solution.
Hi Ken,
I managed to squeak out some testing this evening and found that that this may be related to some updates we are making to our API. This appears to be the result of a progressive update of our API. The udpated servers will not accept this XML, because they run a validation of StateCode and StateName to ensure they match the given CountryCode or CountryName (if provided). In your XML, you actually have the StateCode "MA" in the StateName element. Adding it instead as a StateCode worked every time in my testing.
Moving forward, our API will be more rigorously validating these for correspondence.
Hi Ken,
The python library was put out as open source and unsupported by Constant Contact Labs, but regardless I'm happy to help try and diagnose the issues using RESTClient (which you can also do)... Unfortunately, I've identified an inconsistency in repsonses to the same request that indicates we may be having an issue with our API Services at this time. I hope to have more to report on this by later this evening, but at this hour, I may not have moreuntil the morning.
Hi Ken,
I managed to squeak out some testing this evening and found that that this may be related to some updates we are making to our API. This appears to be the result of a progressive update of our API. The udpated servers will not accept this XML, because they run a validation of StateCode and StateName to ensure they match the given CountryCode or CountryName (if provided). In your XML, you actually have the StateCode "MA" in the StateName element. Adding it instead as a StateCode worked every time in my testing.
Moving forward, our API will be more rigorously validating these for correspondence.
Hi Mark,
You nailed it! Changing the state name to state code worked like a charm. Unfortunately, we are adding contacts dynamically using user-entered values which we're not validating for the sake of convenience. Having rigid state name/code requirements might be an issue if users aren't careful entering data, or if they type of the state name instead of the code. I wonder if other users are experiencing similar issues.
This certainly helps, though, and should work for most of our new contacts. I appreciate the quick and helpful response.
Thanks Ken, we're looking at this now. Traditionally, we don't validate StateName. Going to work with our engineering teams to see if this is intentional and a new validation scheme going forward or if this is a bug and we need to fix it. Will post an update once I have that info.
The holidays have come and gone. For many seasonal businesses, this means the rush of shoppers has decreased as well. Instead of turning off the lights and waiting for spring, make your email marketi...
See Article