turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Constant Contact Community
- :
- Developer Community
- :
- Developer Support – ask questions, find answers
- :
- Sign Up information is not getting stored
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Very cool!
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-22-2008 01:28 PM
Well, I thought I knew what the issue was, but I am having a problem still. What exactly is the URI? The reason i ask is that this account is a contact account within a partner account. I just set up the API through the contact account but now wonder if I needed to use the Partner account. If tha tmakes any sense...
Peter
Peter
re: Very Cool (What is the URI)
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-22-2008 03:28 PM
The URI I am referencing is the HTTP address you are referencing in your code. In your code above, for example, this is the URI:
"http://api.constantcontact.com/ws/customers/" . $this->account_username . "/contacts";
From a permissions perspective, the value of account_username in this line MUST be the same as the username you are using for access credentials. I think your code is doing this.
However, because of the way you initialize the account_key parameter, you may be including the account_name twice in this string . Ie - you may be passing APIKey+account_username+account_username. (I am not sure what your updated code looks like now).
Can you echo out your userNamePassword parameter name and make sure that this is not the case?
Thanks,
"http://api.constantcontact.com/ws/customers/" . $this->account_username . "/contacts";
From a permissions perspective, the value of account_username in this line MUST be the same as the username you are using for access credentials. I think your code is doing this.
However, because of the way you initialize the account_key parameter, you may be including the account_name twice in this string . Ie - you may be passing APIKey+account_username+account_username. (I am not sure what your updated code looks like now).
Can you echo out your userNamePassword parameter name and make sure that this is not the case?
Thanks,
Tom M
Group Product Manager – Email Marketing
Group Product Manager – Email Marketing
Ok, found an error
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-22-2008 04:51 PM
Ok, so I found an error, and corrected it, now I get a result of 1. I assume this means success, since it wasn't in the error codes. Unfortunately I don't see my email address in the Awaiting Confirmation list, nor did I get an opt in email confirmation. Is there something else that I am missing? Thanks so much, you have been super helpful!
re: Ok, found an error "result of 1"
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-22-2008 05:46 PM
Something suspicious here Peter. "1" is not a valid response code. Perhaps you are not capturing the response code, but some other value? I expect to see some error trapping some place after your curl_exec line. Your code says:
I do not see where you are testing the HTTP response. For example, the PHP sample code has a block like this:
Are you (or can you) insert something like this?
$response = curl_exec($session);
curl_close($session);
I do not see where you are testing the HTTP response. For example, the PHP sample code has a block like this:
$response = curl_exec($session);
$httpcode = curl_getinfo($session, CURLINFO_HTTP_CODE);
curl_close($session);
if ($httpcode > 199 && $httpcode < 300)
{ echo "It works!!" ; // You might want GET the updated Contact and display it }
else
{ echo "<br> There a Problem <br>Error Code: ". $httpcode ; }
Are you (or can you) insert something like this?
Tom M
Group Product Manager – Email Marketing
Group Product Manager – Email Marketing
HTTP Code
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-22-2008 06:13 PM
Thanks so much Tom! Hopefully this exchange is usefull to someone else some time. Anyway, my $httpcode response is 400. Which, according to that link you sent is a syntax error in the XML (most likely). Here is the XML i am using:
<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/">
<FirstName>' . $this->form_first_name . '</FirstName>
<LastName>' . $this->form_last_name . '</LastName>
<EmailAddress>' . $this->form_email . '</EmailAddress>
<CustomText4>' . $this->form_month . '</CustomText4>
<CustomText5>' . $this->form_day . '</CustomText5>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/' . $this->account_username . '/lists/1" />'
. '<ContactList id="http://api.constantcontact.com/ws/customers/' . $this->account_username . '/lists/2" />'
. '</ContactLists>
</Contact>
</content>
</entry>
Let me know if you seen anything in that which would cause an error. Thanks again!
Peter
<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/">
<FirstName>' . $this->form_first_name . '</FirstName>
<LastName>' . $this->form_last_name . '</LastName>
<EmailAddress>' . $this->form_email . '</EmailAddress>
<CustomText4>' . $this->form_month . '</CustomText4>
<CustomText5>' . $this->form_day . '</CustomText5>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/' . $this->account_username . '/lists/1" />'
. '<ContactList id="http://api.constantcontact.com/ws/customers/' . $this->account_username . '/lists/2" />'
. '</ContactLists>
</Contact>
</content>
</entry>
Let me know if you seen anything in that which would cause an error. Thanks again!
Peter
re: HTTP Code (Contact Post) XML
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-23-2008 09:00 AM
Hi Peter,
When I make a few changes to your XML, it works for me:
1) Change CustomText4 and 5 to CustomField4 and 5
2) Verify that /lists/1 and lists/2 exist for your account
3) Put a valid value in "Updated" (This field will be populated in the POST, so you can put anything - it just has to have the right format).
This XML worked for me:
Thanks,
When I make a few changes to your XML, it works for me:
1) Change CustomText4 and 5 to CustomField4 and 5
2) Verify that /lists/1 and lists/2 exist for your account
3) Put a valid value in "Updated" (This field will be populated in the POST, so you can put anything - it just has to have the right format).
This XML worked for me:
<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text"> </title>
<updated>2008-11-07T22:35:16.497Z</update d>
<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/">
<FirstName>' . $this->form_first_name . '</FirstName>
<LastName>' . $this->form_last_name . '</LastName>
<EmailAddress>a1a1a2@test.com</EmailAddre ss>
<CustomField4>' . $this->form_month . '</CustomField4>
<CustomField5>' . $this->form_day . '</CustomField5>
<OptInSource>ACTION_BY_CUSTOMER</OptInSou rce>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/My AccountName/lists/52" />
</ContactLists>
</Contact>
</content>
</entry>
Thanks,
Tom M
Group Product Manager – Email Marketing
Group Product Manager – Email Marketing
How do I find my list number?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-23-2008 03:14 PM
Hey man, thanks so much. I made all of these changes, but I cannot find out how to find my list number. If you could help me do that, i would totally appreciate it!
re: How do I find my List Number
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-23-2008 04:26 PM
This resource:
http://developer.constantcontact.com/doc/contactLi sts
returns a collection of the Contact lists in your account.
Thanks,
http://developer.constantcontact.com/doc/contactLi
returns a collection of the Contact lists in your account.
Thanks,
Tom M
Group Product Manager – Email Marketing
Group Product Manager – Email Marketing


