Get contacts in a list Issue


#1

We have a static list that is populated via an API call. Prior to populating it is necessary for us to delete the Contacts within the list previously. After looking through the API docs, it seems the only way is to Get contacts in that list (https://api.hubapi.com/contacts/v1/lists/XXX/contacts/all?hapikey=XXX) and then Remove contacts from the list (https://api.hubapi.com/contacts/v1/lists/XXX/remove?hapikey=XXX).

After noticing some issues I began debugging the code and I realized that even if I just forced the code to delete the contacts in the list it would only delete some. I then placed the Get contacts in that list (/api.hubapi.com/contacts/v1/lists/XXX/contacts/all?hapikey=XXX) in the browser and it only shows about half of the people within the list. This would explain why my list would never empty.

Can someone explain why this is happening and how do I achieve my goal?


Contact list (via API) doesn't updates after contact modification
#2

@whitfty1 when making the remove request, does the response contain any discarded or invalid vids?

How many records are you removing from the list? It can take several seconds to remove a large number of records, so if you’re checking immediately after the remove request the remove job may not be complete yet.


#3

Yes there are a few but even before I get to that with just the Get Contacts from list (function) the numbers are off. For example, the list currently has 110 contacts in it. When I plug in the end point (/api.hubapi.com/contacts/v1/lists/XXX/contacts/all?hapikey=XXX) and do a search for ’ “vids” ’ which should show all unique contacts, I only see 77 instances of that


#4

Did you understand my reply or should I try again?


#5

The count issue is related to the removal of the records. As long as a list is still processing and the records are still being removed, you may catch moments where the count of the records doesn’t line up with the current members of the list. You’d want to wait for the list to finish processing (you’ll see "processing": "DONE" in the metadata of the list) before using the numbers or members of the list.


#6

But that is what I’m trying to say. In my case it has now been since 1/27 and the list still isn’t at 0, it still says 110. On top of that, prior to trying to delete, I use the endpoint that is supposed to get all contacts from a specific list and the numbers are different that the 110 in the list as it shows 77 unique uservids.


#7

@whitfty1 can you send me a link to the list you’re looking at? If the list is done processing (which it should be after multiple days) then the count should line up with the number of records in the list, so if you’re seeing something different I’d need to see the list to take a look.


#8

The List is called “Training Credit Eligible” and the list number is 2233. It shows that I have 110 contacts there, however, if you use the end point to get contacts in a list, you will see less unique vids.


#9

Thanks @whitfty1, looking at this now, I’ll reach out to you directly when I have more details.


#10

Great. Thank you so much


#11

I am using the https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=XXX&count=100&showListMemberships=true

But looping it through the offset and getting all the records

However we are not seeing some vids in some lists.