Get List endpoint not returning membership_count in V3 API

RobertS0822
Participant

Get List endpoint not returning membership_count in V3 API

I am using the Get List endpoint (https://v3.developer.constantcontact.com/api_reference/index.html#!/Contact_Lists/getList) to try to get the membership count of a list and the key is not showing up. I've tested this in my code as well as testing it on the page above. Is this feature not working at the moment?

4 REPLIES 4
Aarron_G
Moderator

Hello @RobertS0822,

 

Thank you for bringing this to our attention! The membership_count property is only returned if you pass in a query parameter, which is currently absent from the documentation. I'll look into having the documentation updated. For use in the meantime, the parameter name is "include_membership_count"; possible values are "all" and "active" (which only counts contacts in mailable statuses). Let us know if you have any questions!

 

Regards,


Aarron G.
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.
TADinTX
Occasional Participant

https://api.cc.email/v3/contact_lists/{list_id}?include_membership_count=all does not return the membership count. Am I doing this wrong?
JohnR8516
Regular Participant

I am not sure why they haven't replied to you, but the correct way to get the count is to use the base contact_lists endpoint, not on the individual lists (I think). Like this:

contact_lists?include_membership_count=active 

Then on the response you'll see the count included with each contact list.

To Constant Contact: why isn't this in the documentation yet, and what else is missing?

TADinTX
Occasional Participant

Hey John,

 

Sorry but I am looking for count on a specific list, which the endpoint I posted is supposed to contain (per the documentation). The endpoint you suggest using returns counts for all of the lists, which doesn't help me as much. The real issue here is that the suggestion made by Aaron doesn't seem to be working, or I set it up incorrectly. I hope to hear a response soon!

Developer Portal

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

Visit Page