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.

An Error Occurred

Highlighted
Occasional Participant

An Error Occurred

Hi,


Ive tried using the sample forms and ive only changed the username api key etc. but when i try to add a user I get a An Error Occurred message with no further details. It lists the contacts that I have, im just unable to add any.

5 REPLIES 5
Highlighted
Occasional Participant

I too have experienced this

I too have experienced this 'helpful' error - what on earth does this pertain too? I'm angry that a developer could see fit to just output an unknown error code - that shows a massive lack of understanding of their own code and is a PITA for us to work with.


Anyway, rant aside, @marc, I'm gonna have a play with this and if I have any luck I'll let you know.

Highlighted
Occasional Participant

First step is to change

First step is to change $curl_debug = true in cc_class.php - this then indicates a '400' error.


Further sniffing around the forum indicates it can often pertain to incorrectly specifying a list/group of lists to add the user to. I'm still playing to see if I can fix it.

Highlighted
Employee

400 error in PHP sample

Hello,



I apologize for the issue that you are having. A 400 error usually means that the XML that you are posting has some error in it.



Could you please paste the XML here so that I can look at it and see if the issue lies with the XML being sent to our server.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted

Re: 400 error in PHP sample

I am getting this same error by using the sample simple form. Was there ever a fix for this?

Highlighted
Employee

Re: 400 error in PHP sample

Hey Becky,


This typically happens when there is no list selected when you are working with the sample forms.  If your lists are not displaying you should check the cc_class.php.  It should be set up similar to this:

 

var $login = 'enter your username here'; //Username for your account
        var $password = 'enter your password here'; //Password for your account
        var $apikey = 'enter your api key here'; // API Key for your account.
        
        // CONTACT LIST OPTIONS
        var $contact_lists = array(); // Define which lists will be available for sign-up.
        var $force_lists = false; // Set this to true to take away the ability for users to select and de-select lists
        var $show_contact_lists = true; // Set this to false to hide the list name(s) on the sign-up form.
        // NOTE - Contact Lists will only be hidden if force_lists is set to true. This is to prevent available checkboxes form being hidden.
                
        // FORM OPT IN SOURCE - (Who is performing these actions?)
        var $actionBy = 'ACTION_BY_CUSTOMER'; // Values: ACTION_BY_CUSTOMER or ACTION_BY_CONTACT
        // ACTION_BY_CUSTOMER - Constant Contact Account holder. Used in internal applications.
        // ACTION_BY_CONTACT - Action by Site visitor. Used in web site sign-up forms.
        
        // DEBUGGING
        var $curl_debug = false; // Set this to true to see the response code returned by cURL
        
        // YOUR BASIC CHANGES SHOULD END HERE
        var $requestLogin; //this contains full authentication string.
        var $lastError = ''; // this variable will contain last error message (if any)
        var $apiPath = 'https://api.constantcontact.com/ws/customers/'; //is used for server calls.
        var $doNotIncludeLists = array('Removed', 'Do Not Mail', 'Active'); //define which lists shouldn't be returned.

 Please let me know if this helps.

Ryan Davis
Quality Engineer
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