Get Contacts from contact list using email

I know that we have contact list api to fetch all the contacts inside a list. I would like to know if there is a way to fetch only one contact from the list using just the email.

Hi @VNambiar ,

If you know the email why not use this contact endpoint?

Hello @dennisedson,

I was wondering about almost the same question, is this api you mentioned - not going to be deprecated? Right now I’m basing my thouhgts on new documentation: Accounts Dashboard | HubSpot and it doesn’t have a method to update contact just by their email as I understand.

@daniiliciouz , this will not be deprecated anytime soon. And the team is working on an equivalent for the V3 APIs so you will be able to smoothly transition when it is time

Yes, but I also want to make sure that it exists in a particular list. I mean i want to check whether the user associated with the email id provided is a member of one particular list, say list_id: 2

@VNambiar could you write this logic into your app? Probably need more context to fully understand this \

@RMones , what do you think?

@dennisedson , I will explain my scenario in detail.
1. I have a mobile application that lets my users chat with each other.
2. My users are of two categories: a) Freemium b)Premium.
3. Whenever a new user is registered with the app then they are put in the Freemium list.(No cotanct list for this category)
4. When the user is subscribed to the app then they are put in to a contact list of Premium.
5. So in my application whenever a user logs in I need to check if that particular user is a premium member or not.
6. So currently I am doing it by hiting the contact list api that fetches me all of the contacts in that list and then in the application I am iterating through all of the contacts to check for the current user’s email ID in it.
7. So the problem here is that this will work when there are few users. But my application will have 10000 and more users so this will be a heavey task of iteration for the mobile application.
So I was wondering if the api has some filter parameters that would let me know with the help of the email ID whether the provided email ID is the member of the list or not, rather than getting all the contacts from the list. Or any other api that would help me deal with this situation.
Thank you,
Vineeth

Hi @VNambiar ,

Is it not easier for you to use the search API for Contacts?

Check if a contact with the email address exists, if yes, then Get the the Contact by the Id via via https://legacydocs.hubspot.com/docs/methods/contacts/get_contact

and check if your user is in the “list-memberships” list.

Or another option is (I think much easier):
Create e new propery; membership_type or something.
If a User will register for Premium, set a property on the Contact from Freemium to Premium.
If a User logs in, then search with the Contact API for the Email adress and add the new property to your search request to add it to the response of hubspot.

And then check the new property for his value; Freemium or Premium.

Greets,

Ronald

@RMones , Thanks a lot. This helped me i.e your first solution. I used the contact api to get the user’s profile by their email ID and checked inside the “list-membership” to check if the user is a member of a list. The second solution also looks promising for me, I will try that too. Thanks a lot once again to everyone.

can you send to me the code