Missing column when accessing hubspot-api-client (python)

Hi folks,

I’m experiencing some missing columns issues when accessing Hubspot API programmatically through Python.

Our model is divided into 3 main tables (DEALS, COMPANIES and CONTACTS)

I’m fectching all DEALS columns as follows :

deals_properties = api_client.crm.properties.core_api.get_all(object_type="DEALS")
deals_colonnes = {x['name']:x['label'] for x in deals_properties.to_dict()['results']}

all_deals = api_client.crm.deals.get_all(properties=list(deals_colonnes.keys()))
all_deals_properties = [x.to_dict()['properties'] for x in all_deals]

df_deals = pd.DataFrame.from_records(all_deals_properties)

df_deals = df_deals.rename(columns=deals_colonnes)

I’m missing someting ?

Yours truly,

K.

@BJacobson , any chance you could help out a friend in need :wink:

I think the deals_columns variable should be formatted as a JSON. The above link has some samples that will need to be modified to work with python.

feel free to check out my Hubspot Post on GitHub (it is for importing contacts, but the JSON format should be able to be copied and modified for your export)

Cheers,

Brandon

https://github.com/KayakerS6/HubSpotPythonAPI

kayakers6@gmail.com

Hi Brandon,
I need to make further investigations as the problem might inherent from our own model.

I will accept your reply as a solution and keep you informed.

Best,
Kikala.