. '<ContactList id="http://api.constantcontact.com/ws/customers/' . $UN . '/lists/2" />' // Be sure to get the correct list number(s) for your list(s)
Mike C Support Engineer, Constant Contact
Mike C Support Engineer, Constant Contact
I am having some issues with this code as well. I keep getting a Error 401: Error reported: 401
to be sure, the
$UN - this would be constant contact login info?
$PW - this would be the password for the account?
$Key - this would be the api key
i am using this curl code
// Initialize the cURL session
$request ="https://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_BASIC);
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
Might want to try adding this line to your options:
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, 0);
James Benson, PHP Developer.
Constant Contact Services: http://integrationservic.es/
The holidays have come and gone. For many seasonal businesses, this means the rush of shoppers has decreased as well. Instead of turning off the lights and waiting for spring, make your email marketi...
See Article