get contact : company using API

Hi Devs,

My name is Bintang, I am actually quite new with this platform and have a basic of programming language.

Currently I have a goal to pull all the contact data using API in python. I follow the github repo by using get_all:

using this method, i can get the contact data, but it is not completed. It doesn’t include like the company data, contact owner, and phone number. In the code there is also a note stated that “pagination is used under the hood to get all results”.

Could somebody please explain me what this sentence means and how is the step i should do/read to achieve this goal?

I really appreciate your kind effort.

Thanks,

@bintangazhari

Hi.

How about set optional parameter “properties”?

:param list[str] properties: A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.

https://github.com/HubSpot/hubspot-api-python/blob/master/hubspot/crm/contacts/api/basic_api.py#L389

# not tested
all_contacts = api_client.crm.contacts.get_all(properties=["foo","bar"])

Thanks.

Hi @skimura ,

Thanks for your reply and your reference.

After exploring, i found associations_api.py which contains get_all function.

But, i can’t find the list of parameters that i can use to get the company name.

Or maybe do you know where I can find the parameter list so I can set some parameter to include the company info?

Thanks,

@bintangazhari

Hi.

“But, i can’t find the list of parameters that i can use to get the company name.”

You need property’s "Internal name", it used by API request “property”.

Please check this, and find your property’s internal name.

Thanks.

Hi @skimura

Thanks for your kind support.

After following your guidance to check the internal name, and adding the properties, finally i can pull the company name.

Thanks for your kind support!