Add New Contact and Figuring out List ID's

Highlighted
Member

Add New Contact and Figuring out List ID's

Hi,

 

Got a backend application that would attempt adding users to contact lists.

 

I've got a solution using cc_class.php

 

And the following XML document returns an error "An Error Occured"

 

 

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"><title>TitleNode</title><updated>2011-05-10T17:19:53+01:00</updated><author><name>[Value Passed in Realtime]</name></author><id>http://api.constantcontact.com/ws/customers/[Value Passed in Realtime]/contacts</id><summary type="text">Customer document</summary><content type="application/vnd.ctct+xml"><Contact xmlns="http://ws.constantcontact.com/ns/1.0/">Customer document<EmailAddress>yohan@intimateinteractive.com</EmailAddress><FirstName>Karen</FirstName><LastName>Althouse</LastName><OptInSource>ACTION_BY_CUSTOMER</OptInSource><ContactLists><ContactList id=">[Value Passed in Realtime]"/></ContactLists></Contact></content></entry>

 

 


What am I doing wrong? and how do I go about getting a List ID ? all I see is the name of the List.

 

All I want to do is, uisng the First, Last name and Email Address that's available to the application in realtime, initialte the add to contact process.

 

Thanks in advance

 

 

Cheers

 

 

Yohan

AIM @ iiyohan

1 REPLY 1
Highlighted
CTCT Employee

Re: Add New Contact and Figuring out List ID's

Hello,

 

I can definitely help you with the issue that you are having with your XML.  I took a look at it and I see that the only issue is that you need to have at least one contact list already added when you add the contact.  The best way to get the contact list ID is to pull the list of contact lists in the API.  You can do this by using the getLists function in the cc_class file.

 

If you have any questions please let me know.

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured