Hi, we use the API to add users to our Constant Contact mailing lists and we are suddenly having a problem with all the forms that do this on our site. Has there been a change or update to the API recently that might have caused something we have to break?
For example, this is one of our forms that has been working fine until late http://www.coachingsteps.com/7steps/
Would appreciate any info that could help. Thanks, Janet
There have been no changes to the API recently that should cause your sign up for to no longer work. I attempted to sign up on your website and it did say that I successfully signed up. I checked your account as well and see that I did sign up for your list without issue. Can you go into more details on what problems you're seeing? You can also send your code to our webservices support team and we can look at the actual code to see if there are any problems as well.
I saw your sign up go through okay too. For the past couple/few days, the page just hangs then seems to time out. I just tested the same page with a ficticious email (that I knew would not be already signed up) and it worked fine (and immediately) as yours did. However, I just tested the same email with another form on the website that uses a different email list (http://www.coachingsteps.com/registerseminar/) ...and the page is hanging again. I can't quite determine the pattern or what is going on with the issue. I will send code to the webservices support team.
Thanks for your help, Janet
We looked at your code and everything there is working perfectly. Using a test server we are able to run it without issue every time. We did notice that other pages that make no requests to the API are also taking a long time to load. I would recommend getting in touch with your website hosting company or your website admin to see if there is something going with your website.
I did notice that your script (which is our older sample php form) is using the built in method for PHP PUT requests. We have noticed that on some server/php configurations this can hang. While we have never been able to isolate the exact cause, a Constant Contact customer did find a workaround that allows it to work everytime. You will simply need to change one line of code:
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
I've tried this in one place for 3 registrations and it is working beautifully. Tried the other URL and it hang, then updated the code, and it worked. I believe that this fixed the issue -- thanks so much!!!