# Syncing Hubspot with Drupal

**URL:** <https://community.hubspot.com/t/syncing-hubspot-with-drupal/14480>\
**Category:** APIs & Integrations\
**Tags:** object, contacts\
**Created:** [May 22, 2019, 6:48am UTC](https://community.hubspot.com/t/syncing-hubspot-with-drupal/14480 "2019-05-22T06:48:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![snavas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/snavas/32/76463_2.png) [@snavas](https://community.hubspot.com/u/snavas)\
**Post date:** [May 22, 2019, 6:48am UTC](https://community.hubspot.com/t/syncing-hubspot-with-drupal/14480/1 "2019-05-22T06:48:54Z")

</div>

I’m working on a project that creates an eCommerce bridge between Drupal and Hubspot. We’ve implemented the task of enabling the bridge and syncing contacts/deals/products/line items between Drupal and Hubspot via sync messages. That is working fine.

Our next task is to sync changes between Hubspot to Drupal. So, if changes are made on the Hubspot contacts/deals we’d like them to be synced with Drupal as well. **We’d like to run a cron task every day that queries Hubspot to get the changes made to contacts/deals on Hubspot that haven’t been synced with Drupal yet.**

So, my question is, what is the best way to go about it. From the documentation, I see that there are two options: webhooks and making API calls. We’d like to defer on the webhooks implementation for the time-being as the chances of notifications being lost could be an issue because we have a huge data bank that will be updated quite frequently. So, that leaves us with the API calls.

The current confusion I have with it though, is, if we run an API call to [get the recently update contacts](https://developers.hubspot.com/docs/methods/contacts/get_recently_updated_contacts), will it _ **just** _ fetch the contacts that were updated directly on Hubspot? Or will it also fetch contacts that were updated from other integrations, for example, the Drupal to Hubspot sync? Because that could potentially cause a circular loop, where, we sync contacts from Drupal to Hubspot, then, in the API call to sync between Hubspot and Drupal, it also pulls in those contacts updated from Drupal.

**Is there a way we can specify in the API call to fetch only changes made directly on Hubspot?**

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [May 24, 2019, 2:34pm UTC](https://community.hubspot.com/t/syncing-hubspot-with-drupal/14480/2 "2019-05-24T14:34:03Z")

</div>

Hi, @snavas.

Thanks for posting; I appreciate all the detail!

In the long run, I think [webhook subscriptions](https://developers.hubspot.com/docs/methods/webhooks/webhooks-overview) may indeed be your best bet, but let’s talk about polling for now.

Endpoints like _[Get recently updated and created contacts](https://developers.hubspot.com/docs/methods/contacts/get_recently_updated_contacts)_ will return _all_ new and recently modified contacts, _regardless of source_.

While there isn’t a way for the API to exclude updates made by your or other apps, you can include the `propertyMode=value_and_history` parameter to see each property’s value history in a `versions` array. The `source-type` and `source-id` fields alongside each value reflect who or what updated the property.

For example:

```auto
"properties": {
 "firstname": {
 "value": "Isaac",
 "versions": [
 {
 "value": "Isaac",
 "source-type": "IMPORT",
 "source-id": "a8e67286-08a9-4965-84bb-dc6001a06910",
 "source-label": "First Name",
 "timestamp": 1558707463109,
 "selected": false
 }
 ]
 }

```

Changes made by your OAuth app should have the `"source-type": "INTEGRATIONS"` and a `source-id` of your [app ID](https://developers.hubspot.com/docs/faq/how-do-i-find-the-app-id). You can then exclude these contacts or deals on your end.

I should note that the _[Get recently modified [and created] deal](https://developers.hubspot.com/docs/methods/deals/get_deals_modified)s_ endpoint uses slightly different syntax. Instead of`propertyMode=value_and_history`, you would use`includePropertyVersions=true`. Deals also use `source` and `sourceId` fields instead of `source-type` and `source-id`.

---

<div class="post-metadata">

**Author:** ![Pumex\_Infotech](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pumex_infotech/32/95846_2.png) [@Pumex\_Infotech](https://community.hubspot.com/u/Pumex_Infotech)\
**Post date:** [July 22, 2026, 11:44am UTC](https://community.hubspot.com/t/syncing-hubspot-with-drupal/14480/3 "2026-07-22T11:44:11Z")

</div>

The HubSpot-Drupal connector is now live and is free to use. [HubSpot Marketplace](https://ecosystem.hubspot.com/marketplace/listing/drupalbridge)
