Custom Object API Import

Im trying to import custom objects directly into hubspot form my internal database. I know I can do this to contacts/companies. Im not sure how to do it with custom objects. This is what I have so far with no luck

inputs = [{'properties': {'branch_name': branches[id][0],
 'b_number': branches[id][4]
 }}]
 try:
 branch_upload = client.crm.objects.basic_api.create(object_type="branches",
 simple_public_object_input_for_create=inputs
 )

 pprint(branch_upload)
 except ApiException as e:
 print("Exception when requesting custom objects: %s\n" % e)

Hi @DLee31

I recommend Version 3 of the HubSpot API – Create a New Schema.

Have fun

Mike

Here to learn more about HubSpot and share my HubSpot Knowledge. I’m the founder of Webalite a HubSpot Partner Agency based in Wellington, New Zealand and the founder of Portal-iQ the world’s first automated HubSpot Portal Audit that helps you work smarter with HubSpot.

@Mike_Eastwood This Schema shows for how to make a custom object. Not importing data into the already created custom object. Im needing to import data into an existing custom object

Sorry @DLee31 I misunderstood.

You can use the Custom Objects API to push data into HubSpot.

POST to

/crm/v3/objects/{objectType}

Where the Object type is the ID not the name e.g. 2-6499236

The easiest way (I think) to fiind the Object ID is to visit the page in your CRM where you see the Custom Objects and check the URL:

Loading...{{ portal_id }}/objects/{{ object_id }}/views/all/list

Hope that helps!

Mike