Links

Get all deals

Tags: #hubspot #crm #sales #deal #naas_drivers #snippet #dataframe
Author: Florent Ravenel
Description : This notebook get all deals from HubSpot. Data will be returned as dataframe with columns equal to properties.

Input

Import libraries

from naas_drivers import hubspot

Setup HubSpot

👉 Starting November 30, 2022, HubSpot API keys no longer enable access to HubSpot APIs, so in Naas version 2.8.3 and above, you need create a private app and use the access token.
Enter Your Access Token
HS_ACCESS_TOKEN = naas.secret.get("HS_ACCESS_TOKEN") or "YOUR_HS_ACCESS_TOKEN"
Define Deal properties
List of properties you want to get from deal. By default, you will get:
  • dealname
  • amount
  • dealstage
  • pipeline
  • createdate
  • closedate
  • hs_object_id
  • hs_lastmodifieddate
properties = []

Model

Get all deals

df_deals = hubspot.connect(HS_ACCESS_TOKEN).deals.get_all(properties)

Output

Display result

df_deals