- Constant Contact Community
- :
- Developer Community
- :
- Developer Support – ask questions, find answers
- :
- re: Having a similar issue
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Sign Up informatio n is not getting stored
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-11-2008 09:22 AM
We have client which uses the ConstantContact API for the storing the sign up information and sending email. The contacts were getting saved properly before some time, but suddenly it has stopped storing the information of the signed up contact. Will you please let me know how can I look into this issue and which approach to be used. Since this was working before i feel that something at the Constantcontact API or site is changed, if not please help me out in getting a solution for this.
Thanks,
Manjushree
re: Signup Informatio n
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-11-2008 11:53 AM
- Has the username or password on the Constant Contact account changed? Both are used in the script to add Contacts.
- Has the Contact List which the contacts are added to been deleted or renamed? That would break it.
Next, you should look at the script itself. Make sure that the script is trapping errors returned on the API call. Once you have more details on the specific error codes and messages, please post here again.
Thanks,
Group Product Manager – Email Marketing
Want to store contact informatio n with constantco ntact
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-16-2008 04:12 AM
Thanks for a quick reply. My client is holding an account with you. They want to implement a functionality to store the contact information with constant contact so that later on the email's can be send to the customers present in the contact list. Please let me know how can I go ahead with the imlpementation wise. Which API to use just to save the username and the email address with ?
Username: lesliejones
It's bit urgent. Waiting for a quick reply.
Thanks,
Manjushree
re: Sign Up Informatio n (Storing)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-16-2008 08:19 AM
If your customer is simply looking to upload a contact every now and then, you should consider the Yahoo widget.
If you are looking to create an application which stores a single contact, or a few contacts at a time, you should use the Contacts Resource. There are several language specific examples of the use of this API in this forum, including a PHP example in this thread.
If you are looking to upload a list of contacts in a single operation (ie. a bulk upload), you will want to use the Activities Resource. You can find examples of the use of this resource both in the forums, and on this page.
(If you have a Site Visitor API based integration that was working before and is no longer working - consider starting with the troubleshooting comments made in my earlier post. The Site Visitor API is an alternative approach to adding contacts and should still work for you).
Thanks,
Group Product Manager – Email Marketing
Having Similar issue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-18-2008 06:48 PM
Here is the info I am using (with the personal info omitted of course) :
$form->account_username = "accountname"; // CONSTANT CONTACT ACCOUNT INFO //
$form->account_password = "accountpassword"; // CONSTANT CONTACT ACCOUNT INFO //
$form->account_key = " apikeyr23423948234890908%accountname"; // CONSTANT CONTACT ACCOUNT INFO //
is there something else that should be included in the login information?
Thanks!
re: Having a similar issue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-19-2008 08:50 AM
account_key as the username in your post? Thanks,
Group Product Manager – Email Marketing
Here is the code that I am using
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-19-2008 10:43 AM
/////////////////////////////////
'
. '
. '
';
$request ="http://api.constantcontact.com/ws/customers/" . $this->account_username . "/contacts";
$session = curl_init($request);
$userNamePassword = $this->account_key . '%' . $this->account_username . ':' . $this->account_password ;
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);
curl_setopt($session, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($session);
curl_close($session);
ob_start();
include($this->email_template);
$template = ob_get_contents();
ob_clean();
$send_email = mail($this->form_email, $this->email_subject, $template, $this->email_headers);
if($send_email){
header("Location: " . $this->email_return_path);
exit;
}
}
}
?>
/////////////////////////////////////////
Below is the actual form with the class variables. I have removed anything that is specific to our account, but this should give you an idea of what we are doing:
////////////////////////////////////////
// execute only if form is sent - determined by the hidden form value "sent" //
if($_REQUEST){
// include class //
require_once('form.class/index.php');
// create new instance of form_send class //
$form = new form_send;
// set up class properties //
$form->form_first_name = trim(stripslashes($_POST));
$form->form_last_name = trim(stripslashes($_POST));
$form->form_email = trim(stripslashes($_POST));
$form->form_month = trim(stripslashes($_POST));
$form->form_day = trim(stripslashes($_POST));
$form->form_expire = date("l, F j, Y", mktime(0, 0, 0, date("m") , date("d")+28, date("Y"))); // can be altered an may not be needed for all forms //
$form->account_username = "ourusername"; // CONSTANT CONTACT ACCOUNT INFO //
$form->account_password = "ourpassword"; // CONSTANT CONTACT ACCOUNT INFO //
$form->account_key = " apicode-numbers-gohe-reandthensome%ourusername"; // CONSTANT CONTACT ACCOUNT INFO //
$form->email_subject = "Thank you for joining ourstuff"; // your email subject line here //
$form->email_template = "mail.templates/index.php"; // path to mailo template - relative to this file not the class //
$form->email_headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'From: ourstuff
$form->email_return_path = "thank-you.php"; // return path can be absolute or relative to document //
// Now execute the send by calling send_and_return method //
$form->send_and_return();
}
?>
///////////////////////////////////
When i go to the account manager, I cannot find my submission in the Awaiting Confirmation field and I don't get a second opt in email. I do get our custom email, which I am going to probably have to remove until after they click on the second opt in email. I would be interested in knowing if anyone has a sample of sending the second opt in email and if it can be customized, but more importantly i want to get this form hooked up so that it adds users to the database.
Thanks!
Peter
RE: Here is the code that I am using
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-19-2008 07:23 PM
I see two issues with your code.
The first issue is with Your XML Data you are posting. The following is wrong
<Email>' . $this->form_email . '</Email>
It should be
<EmailAddress>' . $this->form_email . ' </EmailAddress>
The second issue I see is with this line
$form->account_key = "apicode-numbers-gohe-reandthensome%ourusername"; // CONSTANT CONTACT ACCOUNT INFO //
It should be
$form->account_key = "APIKeYONLY"; // CONSTANT CONTACT ACCOUNT INFO
If your code does not work after making the following changes then please echo your $response so you can see what the error is.
Mike C Support Engineer, Constant Contact
I get a 401 error...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-22-2008 12:11 PM
re: 401 Error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-22-2008 12:54 PM
Summary of error codes can be found here.
Thanks,
Group Product Manager – Email Marketing


