This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from pandas.io.json import json_normalize | |
import requests | |
from configparser import ConfigParser | |
dir_path = '.' | |
config = ConfigParser() | |
config_file = dir_path+'/config.ini' | |
config.read(config_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
def get_contact_by_email(email, access_token, properties=[]): | |
"""Gets Contact, along with properties noted by list of API names""" | |
url = f"https://api.hubapi.com/crm/v3/objects/contacts/{email}?idProperty=email" | |
for prop in properties: | |
url += f"&properties={prop}" |