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.
I got it working. Thank god, I was getting so frustrated last night. :smileyhappy: But here's the things, heres the code im using: $emailaddress = "firstname.lastname@example.org"; /////////// REGISTER EMAIL WITH CONSTANT CONTACT /////////////////// $UN = ""; $PW = ""; $Key = ""; $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>' . $emailaddress . '</EmailAddress> <OptInSource>ACTION_BY_CONTACT</OptInSource> <ContactLists> <ContactList id="http://api.constantcontact.com/ws/customers/' . $UN . '/lists/1" /> </ContactLists> </Contact> </content>'; // 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 // Execute cURL session and close it $response = curl_exec($session); curl_close($session); How do I make it for my clients? Because I don't want to ask them for their password, I see that I can do Oath 2 But where and how could I do that? Is there a field I could put the auth token or?
... View more
I'm using the php add contact code. I want to simply add a user to list of my cleints. My clients have constant contact. It's a shame that CC does nto simply allow a curl post to instanly add a contact. My problem is, with the php add contact I've inputted my information but I get an error: "OAuth Exception: Username raverandi not found in datastore Click here to authorize" Now, I don't know what to put in the user name field. Is it my cleints username , or mine? If it's mine, then were do I place my cleints user name. I don't have the time to dedicated the arragont reason on why CC does not opperate like other networks. I'm considering dropping CC as an option unless I find out how to do this. I've looked everywhere but can't find it.
... View more