I am trying to add a contact email to an existing list in CC. I am using PHP with the wrapper provided by CC. I have verified the variable being passed as the list ID as coming from the $ConstantContact->getLists(); call.
I currently get this error:
Constant Contact HTTP Request Exception: Error 400: The new contact must contain at least one valid ContactList
$username = 'xxx';
$apiKey = 'xxx';
$consumerSecret = 'xxx';
$Datastore = new CTCTDataStore();
$sessionConsumer = array(
'key' => 'xxx',
'secret' => 'xxx',
'username' => 'xxx'
$DatastoreUser = $Datastore->lookupUser($username);
$ConstantContact = new ConstantContact('oauth', $apiKey, $DatastoreUser['username'], $consumerSecret);
$Contact = new Contact();
$Contact->emailAddress = "email@example.com";
$Contact->lists = "http://api.constantcontact.com/ws/customers/xxx/lists/1";
$NewContact = $ConstantContact->addContact($Contact);
Can somebody please update the documentation to reflect this so others don't spend time spinning their wheels like I did before coming the forum for the answer?
If you are referring to the documentation on github, I am currently in the process of rewriting it all.