Calling All Developers 
Connect with fellow code ninjas in the Constant Contact Community.

Reply
Moderator
Posts: 86
Registered: ‎04-01-2013

How to Find a list's listID

We get requests sometimes from users of older integrations, asking for their list ID’s. It varies by account, but about a year ago, our accounts stopped showing list ID’s in the URL of some pages. Now, the only way to get list ID’s is through the API.

 

Some 3rd party integrations with Constant Contact are requiring users to know the listId instead of the list name for some actions. This post explains how you can obtain the listIds for all of  your contact lists.

 

Ideally, the application should just pull the listIds in an account automatically, show users the name of the list, and allow them to select which lists to use. Users should not be asked to provide this information. We encourage you to submit feedback to the company that developed the app you’re using to ask them to pull lists automatically without asking you for the list ID. The app developers can email webservices@constantcontact.com for help. We want to make this as painless as possible.

 

As a workaround, you can use the following steps to obtain the list ID’s in your account: 

 

  1. Go to http://developer.constantcontact.com/api-keys.html and follow the 3 steps under "Request an API Key.” 
  2. After you generate your access token, go to the IO Docs page (or stay there if you were already there): https://constantcontact.mashery.com/io-docs.
  3. Fill in your API Key and access token near the top of the page.

    key_token.PNG












  4. Scroll down to the ContactList methods, and click on GET: Retrieve a collection of ContactLists.
    contactlistmethods.PNG
  5. Click Try It!. This will send a request to your account to retrieve all of the lists in your account. 

  6. Scroll down to the Response Body section, and you will the see the data for all lists in your account; each list has 6 lines of data, one of which is the id, shown here:
    {
       
    "id": "1356756687",
       
    "name": "Best Opportunities",
       
    "status": "ACTIVE",
       
    "created_date": "2014-06-30T16:25:41.000Z",
       
    "modified_date": "2014-06-30T12:25:41.000-04:00",
       
    "contact_count": 3
    },

 

 

Rich Marcucella
Sr. Technical Writer, Content Developer
Web Services Team
http://developer.constantcontact.com