First off hubspot makes it really easy to get all native objects out of hubspot a number of ways. The Way I prefer is using this
company = api_client.crm.companies.get_all(properties=[])
Is there a simliar call for custom objects? I have not found one and this is what my current attempt is to kinda do the same thing. However it will need adjustment since the database will grow above the set number for 52 calls needed.
iter_id = 0
while i < 52:
branch = client.crm.objects.basic_api.get_page(object_type="branches",
limit=100,
after=iter_id,
properties=["hs_object_id"]
archived=False)
#pprint(branch)
branch = branch.to_dict()
for data in branch['results']:
branch_data = {
'Hubspot ID': bran['properties']['hs_object_id'],
}
iter_id = data['properties']['hs_object_id']
branch_list.append(branch_data)
i += 1
Any guidance is appreciated. End goal is to put the data in a csv file using API.
I know there is a way to download it using this export endpoint however I think that requires a manual download and that is not wanted