Website Registration is no longer updating the general list contact list as 0f Nov 25th for www.bybloscafe.com

Participant

Website Registration is no longer updating the general list contact list as 0f Nov 25th for www.bybloscafe.com

I recently noticed that all the people that registered after Nov 25th on my site are no longer being updated on the list.  I spoke to my site designer about it and here is his response: (subject: www.bybloscafe.com)


 I suspect there might be a change at Constant Contact in the way these things are processed.  If you check with them first and gather as much information as you can for me, it could save time and money in getting the code updated.  Once we have the names adding automatically again as before, then I can go into the database, retrieve the missing ones and add them to your list.  If I do it now, I'll have to do it all over again after we get the code updated.

 

Below is the code used to update the list.  It hasn't changed since we started.  You can provide the code to Constant Contact support in case they have questions about what method you are using:

 

 

<?php

 

$first_name = ($_GET);

$middle_name = ($_GET);

$last_name = ($_GET);

$email = ($_GET);

$phone = $_GET;

 

/////////// REGISTER EMAIL WITH CONSTANT CONTACT ///////////////////

 

$UN = "bybloscafe";

$PW = "andrew1";

$Key = "0e444086-b395-4a38-9917-ddbf5110fa84";

 

$entry = '<entry xmlns="http://www.w3.org/2005/Atom">

<title type="text"> </title>

<updated>' . date('c') . '</updated>

<author></author>

<id>data:,none</id>

<summary type="text">Contact</summary>

<content type="application/vnd.ctct+xml">

<Contact xmlns="http://ws.constantcontact.com/ns/1.0/">

<EmailAddress>' . $email . '</EmailAddress>

<FirstName>' . $first_name . '</FirstName>

<MiddleName>' . $middle_name . '</MiddleName>

<LastName>' . $last_name . '</LastName>

<HomePhone>' . $phone . '</HomePhone>

<OptInSource>ACTION_BY_CUSTOMER</OptInSource>

<ContactLists>

<ContactList id="http://api.constantcontact.com/ws/customers/' . $UN . '/lists/1" />' // Do this for all the lists you want to add to

// Be sure to get the correct list number(s) for your list(s)

. '</ContactLists>

</Contact>

</content>

</entry>';

 

// Initialize the cURL session

$request ="http://api.constantcontact.com/ws/customers/" . $UN . "/contacts";

$session = curl_init($request);

 

// Set up digest authentication

$userNamePassword = $Key . '%' . $UN . ':' . $PW ;

 

// Set cURL options

curl_setopt($session, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);

curl_setopt($session, CURLOPT_USERPWD, $userNamePassword);

curl_setopt($session, CURLOPT_POST, 1);

curl_setopt($session, CURLOPT_POSTFIELDS , $entry);

curl_setopt($session, CURLOPT_HTTPHEADER, Array("Content-Type:application/atom+xml"));

curl_setopt($session, CURLOPT_HEADER, false); // Do not return headers

curl_setopt($session, CURLOPT_RETURNTRANSFER, 1); // If you set this to 0, it will take you to a page with the http response

 

// Execute cURL session and close it

$response = curl_exec($session);

curl_close($session);

 

////////////////// END REGISTER EMAIL WITH CONSTANT CONTACT ///////////////////////

 

// Your code goes here: typically sending a confirmation email, and/or a Header("Location: your_page.php") redirect

 

header("Location: http://www.bybloscafe.com/registration_php.php");

 

?>


 


Please help and copy Chad at chad@newvibedesign.com


Roger

 

 

 

Chad Phillips

2 REPLIES 2
Moderator

Hi Chad,


 


Sorry for the problems here but it looks like your code should not have been working since around June of 2009 when we made a change to our Authentication model for the API.  This change was intended to increase security of your information and we sent out multiple notices to all of our API users and registered developers.  You can find information to pass on to your developer on how to fix this PHP script here.  The changes are very simple and are explained in that topic in detail.  I would recommend having your developer go back all the way to June of 2009 to make sure you are not missing contacts from than.

Dave Berard
Senior Product Manager, Constant Contact
Employee

Chad + Roger,


 


You may also want to reference this post (http://developer.constantcontact.com/node/625) explaining the changes that must be done to your script.


 


These instructions were written to assist in updating our old sample code so the line numbers may not be the same however the options that must be changed do correlate to your script.

Dan H

Support Engineer, Constant Contact

Developer Portal

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

Visit Page