APIs & Integrations

KikalaT
Participant

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

SOLVE

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.

0 Upvotes
2 Accepted solutions
BJacobson
Solution
Participant

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

SOLVE

https://developers.hubspot.com/docs/api/crm/search

 

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

View solution in original post

KikalaT
Solution
Participant

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

SOLVE

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.

View solution in original post

0 Upvotes
3 Replies 3
BJacobson
Solution
Participant

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

SOLVE

https://developers.hubspot.com/docs/api/crm/search

 

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

KikalaT
Solution
Participant

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

SOLVE

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.

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

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

SOLVE

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