Followers Are Great, Contacts Are Gold. Create a Free AI-Quiz With Lead Magnet to Share With Your Followers and Own Your Contacts!

Export all contacts from a single list using API

user76761
Rookie
0 Votes

is there a way to export all contacts from a single list? I have list of 30k+ contacts and when I submit a request to generate link, the link only returns 1000. I am not seeing anything queued up either.

Here are my post parameters

            const body = {
                list_ids: [list_id], //this is a single list id
                status: 'active'
                all_active_contacts: true //does not download all of them only 1k
            };
 
Here is the response everytime I try this
 
"state": "completed",
"started_at": "2025-01-29T17:28:52Z",
"completed_at": "2025-01-29T17:28:53Z",
"created_at": "2025-01-29T17:28:52Z",
"updated_at": "2025-01-29T17:28:53Z",
"percent_done": 100,
"activity_errors": [],
"status": {
"items_total_count": 1000,
"items_completed_count": 1000
},
 
It never changes any of the data either. It's always the same. Any suggestions, pointers, guidance is appreciated. Thanks!
 
1 REPLY 1
John__B
Employee
0 Votes

Hello user76761,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

It looks like we've already followed up with you directly via email, but here is the information provided for visibility on the forum:

 

The Bulk Activity endpoints do have some limitations as far as request and file size, so there are a couple of different options available.

 

While you could try just pulling by list (pending that no single list exceeds that amount), you may have an easier time just using GET /contacts and using the pagination functionality, which is not available for bulk endpoints.

 

GET Contacts Collection

https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts

 

When using GET /contacts, you'd want to include whichever contact details are desired, and then set the "limit" query parameter to '500' which is the maximum amount of results that can be returned per call from this endpoint. When you get the response body with those 500 contacts, there will also be a line entry at the end of the results labeled like this:

 

"_links": {

    "next": {

      "href": "/v3/activities/{activity_id}"

    }

  },

 

You would then make a follow-up call to GET /v3/activities/{activity_id}"  using the URL returned for the next page of results (each page will return a different URL), and keep doing this until there is no "next" result at the end of the response body, which will indicate you have reached the end of all of the contacts.

 

Please have a look and let us know if you have any other questions!

 

Regards,


John B.
API Support Specialist
Did I answer your question? If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

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

Visit Page