Nov 2, 2016 5:39 PM
To get a specific list, you first need to know its
listId. You can access a list of all your lists by hitting the ‘Get a set of contact lists’ endpoint. You can then call either the ‘Get a contact list by ID’ endpoint to receive metadata about the list, or the ‘Get contacts in a list’ to get the contacts within a list, including the relevant
listId within the call.
Let me know if you require further assistance.
Nov 3, 2016 7:24 PM
What is the use case you’re attempting to solve here?
The two endpoints mentioned are designed to give you this information; ‘Get a contact list by ID’ will give you the metadata about the given list, and ‘Get contacts in a list’ will return the contacts contained within the list. I’m unclear about what you’re referring to when you say ‘all of the fields within this list’ - Are you referring to the conditions specified for segmentation in the case that the list is a smart list?
Also, worth noting that the HubSpot API uses JSON as its data payload - all responses containing data will be delivered as JSON objects.
Nov 6, 2016 4:51 AM
Sorry ill make myself clear.
I’ve created a list. In that list there are several properties (in which i chose to have in).
So far, from what i saw. i can only get the metadata of this list, or to get the list of the contacts in that list.
My question is, what API i can make in order to receive all of the table, meaning all columns and their value as a JSON object. To clarify more - if the list looks something like this:
I want to get all the information and values for this list (including the ‘red’, ‘blue’ etc) as a JSON object
Nov 7, 2016 9:51 AM
Thanks for the clarification. There isn’t a single endpoint which will give you a single object with all relevant contact properties. What you’d need to do is ::
VIDs of the relevant contacts as URL parameters (
&vid=xxx&vid=xxx…). You’re also able to stipulate which properties the returned object will contain (
&property=x&property=y…), bearing in mind that there will be some default properties regardless of the properties included in the call. Up to 100 contacts can be returned at a time using this endpoint
I hope this is of assistance. Let me know if you encounter any issues.
Nov 7, 2016 10:44 AM
Tnx for getting back to me.
How can i overcome the limit of contacts in the API call?
My final goal is to create an automatic API call everyday and manipulate it after using Python script but i have a lot of contacts…
Nov 7, 2016 2:52 PM
You’ll need to take a divide and conquer approach here, as the maximum returnable contacts in any one request is 100. Iterate through the list of returned contacts from the ‘Get contacts in a list’ call and call the ‘Get group of contacts by id’ endpoint with each group of 100
vids or part thereof.
Jun 19, 2017 4:45 PM
I am running into something similar just looking for more clarification.
My end user maintains a list.
This list contains a subset of properties which we need to return for a specific manual workflow.
I have been tasked with creating an app to return the recent contacts from this list with only those specific properties. (The returned properties will not be static. Properties can be added and removed by the end user.)
When I run the service described here: https://developers.hubspot.com/docs/methods/lists/get_list_contacts_recent
I only return three or four of the properties being stored in the list:
From your above comments this is expected. ***If this is correct why is not documented in the SDK.
Property &property=X - Used in the request URL If you include the “property” parameter, then the properties in the “contact” object in the returned data will only include the property or properties that you request.
The above entry would lead me to believe all of the properties would be returned unless explicitly listed.
If I understand your response above:
“Thanks for the clarification. There isn’t a single endpoint which will give you a single object with all relevant contact properties. What you’d need to do is :
The workflow would be to use the aforementioned service to return the recent contact’s vids. Then use the contacts service to return all of the properties tied to that contact. How do I limit the property values to only what is being selected by the end user in the list?
Thanks in advance,