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.

400 Bad Request when trying to add a contact via web service

Highlighted
Occasional Participant

400 Bad Request when trying to add a contact via web service

I have a number of lists, and when I add a contact into the first list, it works...



<ContactList id=\"http://api.constantcontact.com/ws/customers/MYUSERNAME/lists/1\" />



My problem occurs if I try to add a contact into any other list.  However I'm not sure I'm doing it right.  I have assumed that the "1" at the end of the URL above refers to the list's "Order" number.  So to add into my second list I change the "1" to a "2".  Is that right?  If it is right, is there something else I have to do to make a list accept contacts?

3 REPLIES 3
Highlighted
Occasional Participant

I've established that the

I've established that the number at the end is not the "order" as its displayed on screen.  It appears to be an ID number that gets associated with each list, but is not displayed on screen.


I had created some test lists to start with where the "order" happened to match this hidden "ID".  Later I created the final lists and deleted the test lists.  At that point the "ID" and "order" were no longer in sync.


I've managed to find the IDs for my lists now by trial and error, so my immediate problem has gone away.  However I would like to know how to find out the ID for each list.


 

Highlighted
Occasional Participant

Found it!

After that last post I found the answer.  Go to the web page that shows your lists, use the View source feature of the browser to see the HTML and look through it until you find your list name, the ID is in the anchor tags HREF attribute.


It's a messy way of finding out the numbers, but I would still like to know if the web site can show you these.

Highlighted
Moderator

The number at the end of the

The number at the end of the List URI is the internal ID number we assign to the list.  Each list, when it is created, is given a sequentially increasing number.  You can always retrieve the list IDs by using this URI:


 


https://api.constantcontact.com/ws/customers/{username}/lists


 


Hope this helps!


 

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