Links

Get all contacts

Tags: #hubspot #crm #sales #contact #naas_drivers #snippet #dataframe
Author: Florent Ravenel​
Description: This notebook allows you to retrieve all contacts from HubSpot.

Input

Import libraries

from naas_drivers import hubspot
import naas

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 Contact properties
List of properties you want to get from contact. By default, you will get:
  • email
  • firstname
  • lastname
  • createdate
  • lastmodifieddate
  • hs_object_id
properties = []

Model

Get all contacts

df_contacts = hubspot.connect(HS_ACCESS_TOKEN).contacts.get_all(properties)

Output

Display result

df_contacts