CMS Development

narmstrong
Contributor | Platinum Partner
Contributor | Platinum Partner

Get all the fields set in a list to show up in the JSON

SOLVE

I am using the Hubspot API to try and pull all people in a list and specific contact properties to display elsewhere.

 

Unfortunately, I have not been able to get certain contact properties to show up in the returned JSON object.

 

My query looks like this and the "list_id" and the "$apik" are filled in as needed to query the system.

 

https://api.hubapi.com/contacts/v1/lists/list_id/contacts/all?hapikey=$apek

 

Anyone have an idea of what I am doing wrong.

I want to return the Name, Date, and the Comment contact properties for the people in this list.

Noah Armstrong | TSL Marketing
Senior Developer
6085 Marshalee Dr| Suite 100 | Elkridge, MD 21075
Contact Us

TSL Marketing
0 Upvotes
1 Accepted solution
cathalhopper
Solution
HubSpot Employee
HubSpot Employee

Get all the fields set in a list to show up in the JSON

SOLVE

Hey @narmstrong , I hope all is good with you 🙂

 

You will want to add the parameter &property=[internal property name] for each property you want to return.

 

So your request URL will look something like:
GET : https://api.hubapi.com/contacts/v1/lists/list_id/contacts/all?hapikey=$apik&property=firstname&prope...
If you were not adding any properties to the parameter that is why you wouldn't have seen them return.

You'll see them in the JSON response under properties - if there is no value in the contact for a given property then it won't return that property in the JSON i.e. if no first name is there for a contact firstname won't be returned.

I hope that helps 🙂

Cathal

View solution in original post

2 Replies 2
cathalhopper
Solution
HubSpot Employee
HubSpot Employee

Get all the fields set in a list to show up in the JSON

SOLVE

Hey @narmstrong , I hope all is good with you 🙂

 

You will want to add the parameter &property=[internal property name] for each property you want to return.

 

So your request URL will look something like:
GET : https://api.hubapi.com/contacts/v1/lists/list_id/contacts/all?hapikey=$apik&property=firstname&prope...
If you were not adding any properties to the parameter that is why you wouldn't have seen them return.

You'll see them in the JSON response under properties - if there is no value in the contact for a given property then it won't return that property in the JSON i.e. if no first name is there for a contact firstname won't be returned.

I hope that helps 🙂

Cathal

narmstrong
Contributor | Platinum Partner
Contributor | Platinum Partner

Get all the fields set in a list to show up in the JSON

SOLVE

Thanks. Yes I figured this out this morning.

Noah Armstrong | TSL Marketing
Senior Developer
6085 Marshalee Dr| Suite 100 | Elkridge, MD 21075
Contact Us

TSL Marketing
0 Upvotes