I know there are a few ways to export data from HubSpot. What I’d like to know is, we need to export our Companies and Contacts into our own db tables. For contacts associated with a company, this is the equivalent to a foreign key. I can see in the Portal view of Contact that I can choose the the Contact--> Company. However, this is just the Text Name for the company. Is there a way to export the CompanyRecordId for the Contact Object?
If I were to use the Export API (/crm/v3/exports/export/async) can I define the ComapnyRecordId as part of the objectProperties in the JSON request?
Hello @THa51
you can export the CompanyRecordId for the Contact Object. You can do this by using the Export API (/crm/v3/exports/export/async) and defining the CompanyRecordId as part of the objectProperties in the JSON request.
create a JSON object that contains the following properties. The name of the object that you want to export. In this case, the objectType is “contacts”. objectProperties: A list of properties that you want to export. In this case, you want to export the CompanyRecordId property.
you can use to export the CompanyRecordId property
Once you have made the request, HubSpot will start exporting the data. The export process can take several minutes to complete. Once the export is complete, HubSpot will send you an email with a link to download the exported data.
Basically, you can export 1 FK associated object. You don’t need to specify the properties of the associated object (as you can’t). HS will just include the recordId of the associated object + the primary propert used to display the associated object. So for the above JSON spec, I was able to export the recordId (of contact), recordId (of company) , CompanyName.