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

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?

Occasional Participant

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.


Occasional Participant

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.


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:




Hope this helps!


Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page