APIs & Integrations

ivan3
Participant

i can't access my custom property via api

SOLVE

Im building a api consumer on my localhost.

I added a custom property to contacts and managed to populate it fine using my localhost api consumer but i cant seem to access that specific property. Below is my code -  I can access all other properties just not the custom one.

 

$hubspot = \SevenShores\Hubspot\Factory::create('e5ee3461-4eda-46e7-969e-6d2d2e423b84');

$test = array();
// $test = $hubspot->contacts()->all();
$hubspot_data_raw = $hubspot->contacts()->all();

0 Upvotes
1 Accepted solution
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

i can't access my custom property via api

SOLVE

Hello @ivan3 

 

While fetching contact(s), HubSpot API only returns some basic properties in the response, not all the properties that a contact holds. If you need to get any specific property, you need to specify that in the parameter.

 

https://developers.hubspot.com/docs/methods/contacts/get_contacts

 

Screenshot_2020-04-17 Get all contacts Contacts API.png

Hope this helps.

 

Thanks

 

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

3 Replies 3
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

i can't access my custom property via api

SOLVE

Hello @ivan3 

 

While fetching contact(s), HubSpot API only returns some basic properties in the response, not all the properties that a contact holds. If you need to get any specific property, you need to specify that in the parameter.

 

https://developers.hubspot.com/docs/methods/contacts/get_contacts

 

Screenshot_2020-04-17 Get all contacts Contacts API.png

Hope this helps.

 

Thanks

 

Digital Marketing & Inbound Expert In Growth Hacking Technology
ivan3
Participant

i can't access my custom property via api

SOLVE

ok thanks and i see there is no php code snippet for this functionality is that right? never mind ill just use file_get_contents() and the get url. My next question is - how do i ask for multiple properties? oh never mind i see "May be included multiple times."

0 Upvotes
himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

i can't access my custom property via api

SOLVE

@ivan3 

 

just in the request url of an API call, you need to append it like:

&property=X&property=Y........
where X and Y are the property names that you want to get.

 

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes