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.

List not found error using example addOrUpdateContact.php

Highlighted
Occasional Visitor

List not found error using example addOrUpdateContact.php

What is up with the example php code?

 I'm getting a list not found error using the  example addOrUpdateContact.php.

 Connection and list retrieval works - but the add new contact seems to have issues?

 Is there some param not getting set in the example code that needs to be set?

 

I know the list exists because I added code to print out all the lists returned,

it finds all 3 lists, and the new contact to add is not in the list so that works too,

then it goes to add the  new contact and gets an exception with the error :

[error_key] => json.field.lists.value.invalid
[error_message] => The contact list WebSignup does not exist.

 

What am I missing?  Thanks in advance.

1 REPLY 1
Highlighted
Moderator

Re: List not found error using example addOrUpdateContact.php

When you pass in the ID of the list, you should be using the ID field, not the name.  The error should in this case be interpreted very literally, the id "WebSignup" does not exist.  Since you can change the name of the list at any time, the unique identifier is the ID, which will never change as long as the list exists.  Just use the $contactList->$id value instead of $contactList->$name and you should be all set!

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured