We have a PHP Sample Application that is available for download on this page http://developer.constantcontact.com/doc/samples. This sample application does not include List Creation functionality, but you can look at fileUpload.php for an example of using CURL to perform a POST. This PHP page creates a new Activity resource, so the data being posted is a bit different. It's not posting an Atom entry, but it's posting name/value pairs. The only differences will be in the CURLOPT_POSTFIELDS value and the Content-type. You will have to create a string variable with the XML for the Atom entry, and set that to the CURLOPT_POSTFIELDS variable (see the code for reference). You will also have to set the Content-type to be "application/atom+xml". You can do this by setting the CURLOPT_HTTPHEADER value using the curl_setopt function. This value must be set to an array, so you can set it like this:
curl_setopt($session, CURLOPT_HTTPHEADER, array('Content-Type: application/atom+xml');
If you have any other questions, please let us know.
Kevin Mandeville
Senior Engineer
Constant Contact.
... View more