A delta export retrieves only those matching records that were changed or created since the previous flow successfully ran or from a manually specified date. Certain HubSpot API requests do offer the Delta export type as a built-in option. However, integrator.io is not always able to set the HubSpot query parameters to check the “last exported” ( lastExportDateTime) value that it typically relies on to export only unsynced records. As a safeguard, you can use either of these options:
This option overcomes the limitation in HubSpot's search pagination, that is, 10,000 results for a given query.
Using this option, you can continuously filter the next pages based on the last record received in the previous HubSpot API call. HubSpot allows you to sort the results based on any field, in this case, the lastmodifieddate
field.
-
Create a HubSpot export and enter the general details. See Export data from an HTTP source application
-
In the What would you like to export? section, configure the following details:
{ "limit":100, "sorts": [ { "propertyName": "lastmodifieddate", "direction": "ASCENDING" } ], "filterGroups": [ { "filters": [ { "propertyName": "lastmodifieddate", "operator": "GTE", "value": "{{lastExportDateTime}}" } ] } ] }
-
In Does this API use paging?, configure the following details:
{ "limit":100, "sorts": [ { "propertyName": "lastmodifieddate", "direction": "ASCENDING" } ], "filterGroups": [ { "filters": [ { "propertyName": "lastmodifieddate", "operator": "GT", "value": "{{{previous_page.last_record.properties.lastmodifieddate}}}" } ] } ] }
-
Save and close the export.
This option is limited to 10,000 results for a given query because of the HubSpot search pagination limits. If you want to overcome this limitation, use the above Option A.
Using this option, you can achieve full delta functionality in v3 of the HubSpot API with the following steps:
-
Create a HubSpot export with the following settings:
-
API version: v3
-
API name: CRM API: Companies
-
API endpoint: Search for Companies
-
-
In the Configure body parameters section, click Launch. The Search parameters window opens.
-
Enter the following code in the filterGroups section:
[ { "filters": [ { "propertyName": "hs_lastmodifieddate", "operator": "GT", "value": "{{lastExportDateTime}}" } ] } ]
-
Save and close the filter, and run the flow.
-
Create a HubSpot export with the following settings:
-
API version: v3
-
API name: CRM API: Contacts
-
API endpoint: Search for Contacts
-
-
In the Configure body parameters section, click Launch. The Search parameters window opens.
-
Enter the following code in the filterGroups section:
[ { "filters": [ { "propertyName": "lastmodifieddate", "operator": "GT", "value": "{{lastExportDateTime}}" } ] } ]
-
Save and close the filter, and run the flow.
Note
The Contacts API uses the field lastmodifieddate
whereas the Companies API and the Deals API use hs_lastmodifieddate
.
-
Create a HubSpot export with the following settings:
-
API version: v3
-
API name: CRM API: Deals
-
API endpoint: Search for Deals
-
-
In the Configure body parameters section, click Launch. The Search parameters window opens.
-
Enter the following code in the filterGroups section:
[ { "filters": [ { "propertyName": "hs_lastmodifieddate", "operator": "GT", "value": "{{lastExportDateTime}}" } ] } ]
-
Save and close the filter, and run the flow.
Comments
Please sign in to leave a comment.