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.

Sudden issue with adding contacts. Change in API?

Highlighted
Occasional Participant

Sudden issue with adding contacts. Change in API?

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


 


 

6 REPLIES 6
Highlighted
Moderator

There have been no changes to

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.

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

Page hanging if email already exists?

Hi Dave,


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


 


 

Highlighted
Occasional Participant

Code has been sent to Support



 

Highlighted
Moderator

We looked at your code and

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.

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Moderator

Hi Janet,   I did notice that

Hi Janet,


 


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:


 


Original line:


curl_setopt($ch, CURLOPT_PUT, 1);


 


Update to:


curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

I think that fixed it!

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!!!

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