Version 0.1 API no longer working?

SOLVED
Go to solution
Frequent Participant

Version 0.1 API no longer working?

For several years now, I've been managing a Joomla site for a client of mine, and using version 1.0 of the Constant Contact API without any issues ( to write newsletter signups to specific email lists ). 

 

However, .. it appears that the version 1.0 API is now lo longer working (it always returns the error message "400") , and I am reluctanct to waste time and resources learning and implementing the version 2.0 API ... since I would need to update and test multiple instances of our newsletter signup forms with it.

 

Here is the PHP code I am using (I've subsituted the login name, password and list name with "XXXXXXX" below):

 

<!--- BEGIN CODE //--->

$ccparams = "&First_Name={$_POST['FirstName']}&Last_Name={$_POST['LastName']}&ea={$_POST['EmailAddress']}&Country={$Country}";
$url = "http://api.constantcontact.com/0.1/API_AddSiteVisitor.jsp";
$params = "loginName=XXXXXXX&loginPassword=XXXXXXX&ic=XXXXXX" . $ccparams;
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);

 

<!--- END CODE //--->

 

The one significant change that has occurred recently is that I've been given an entirely different login name and password to use than what I've been using previously --- and I suspect that this might be the reason why I am now receiving error 400. 

 

Is this likely the cause of the problem?  Is access to the API contingent upon it having been granted to the specific login?  If so -- what is the process that I need to go through to grant API access to the new login that I've been given?  I tried registering for one online .. but the process is very confusing and has - so far - resulted in absolutely nothing. 

 

Or is version 1.0 of the API now permanantly dead / deprecated?  Please advise.

 

Thank you,

- Yvan

 

 

 

 

1 ACCEPTED SOLUTION
Frequent Participant

Nevermind.  I ended up having to figure this out on my own.  Thanks anyways.

View solution in original post

10 REPLIES 10
Moderator

This version of our API is actually the 0.1 version, two versions old, and hasn't been given out since 2009 publicly.  While it should not be failing, we also do not actively maintain this API anymore.  We should be returning a more detailed error message in the body of the response.

 

Are you not receiving a detailed error message?  If you were receiving a failure for username/password, for example, the payload would be 500 Invalid Credentials:  User doesn't exist or bad password.  It wouldn't just fail horribly.

Dave Berard
Senior Product Manager, Constant Contact
Frequent Participant

How would I display a more detailed error message? 

Becuase when I display the output for the $results variable, all I get is ...

 

400

 

When I searched this forum for an explanation of this error message, I kept seeing something like the following ...

 

"That error message usually indicates you have something malformed in the XML data that you're sending"

 

But as you can see, I am not sending XML data. I am only posting name/value pairs. So this response likely only pertains to the version 1.0 API -- not the 0.1 API. 

 

I have never needed any kind of API key in order to post data to constant contact -- and all of this worked fine up until about 6 months ago.  The only thing that has changed recently is that I was given a different username and password to use --- which works fine, since I am able to log in to the constant contact account with it, and to create new lists, etc. But for whatever reason, this 0.1 API seems to be broken now. 

 

I've already tried to obtain the old login id and password from my client .. but he says that someone changed the password, .. he doesn't know it, .. and he doesn't have the time to deal with it.  So that's where I'm at.

 

So how would I display a more detailed error message?  

 

Thanks,

- Yvan

 

 

 

 

 

I took a look at your account and notice that you are a multiuser account with more than a single user.  This old API only works for the owner users for the account (the original login for the account).  We are not going to update this older API to support secondary users as this is a depricated and no longer supported API.  If you are looking to use the API with a secondary user for the account, you will need to use our new API instead.

 

When testing this out, I did indeed get a "400" response with no good error messaging when attempting to use a secondary user on my account.  The behavior appears to be the same as what you're reporting.  Let me know if this is not the case or PM me the username you are attempting to use if you'd like me to check which user on the account you are attempting to use.

Dave Berard
Senior Product Manager, Constant Contact
Frequent Participant

I was previously using the loginname of "REMOVED" on this account .. which I am hoping still exists.  

 

Would you by any chance be able to re-set the password for this username for me?  Or could you let me know which email address is associated with it?  Since you've pretty much confirmed my theory, I have a hunch that I might be able to persudate my client to cooperate.

 

Thank you
- Yvan

Constant Contact employees are not able to change passwords for security purposes.  I can PM you the email address associated with this user though so you can use the standard reset password flow to change it yourself. 

Dave Berard
Senior Product Manager, Constant Contact
Frequent Participant

Yes - please PM me the email address associated with the user. 

 

Also -- please post back to this ticket once you've done that, as I suspect that the notification emails are going to an  address other than my own (since I am not receiving any notification emails from constanct contact whenver you reply).

 

Thanks,

- Yvan

 

 

I sent the email address early this morning in a PM, you shoud have it already.

Dave Berard
Senior Product Manager, Constant Contact
Frequent Participant

I did not receive it.  What email address did it get sent to? 

 

 

Frequent Participant

I'm still waiting on a response.  Have I hit a dead end here? 

 

What email address did the PM ge sent to?  Can you disclose that information to me at least? 

 

- Yvan

 

 

Frequent Participant

Nevermind.  I ended up having to figure this out on my own.  Thanks anyways.

View solution in original post

Developer Portal

View API documentation, code samples, get your API key.

Visit Page