pipedream icon indicating copy to clipboard operation
pipedream copied to clipboard

[Refactor] Update Hubspot Sources to use Webhooks

Open dannyroosevelt opened this issue 2 years ago • 3 comments

We should update all relevant Hubspot sources to use webhooks instead of polling, wherever possible. https://developers.hubspot.com/docs/api/webhooks#create-a-new-subscription When registering webhooks in Hubpot, you'll need the Pipedream App ID: 208642

Let's make sure to support the logic outlined in this ticket as well.

dannyroosevelt avatar Aug 29 '22 20:08 dannyroosevelt

I have a hunch for why this wasn't implemented. The hubspot subscription api requires a developer account API key - not OAuth api key - to create a subscription. So, it wouldn't be possible for each component to create its own subscription to an event like "deal.propertyChange" for the account they are connected to.

From Hubspot documentation:

Webhooks are set up for a HubSpot app, not individual accounts. Any accounts that install your app by going through the OAuth flow will be subscribed to its webhook subscriptions.

dangub avatar Aug 31 '22 14:08 dangub

@dannyroosevelt could we set up a second Hubspot app, much like we do for Twitter vs Twitter Developer App?

Then @dangub and others could use their own account API key and utilize webhooks?

ctrlaltdylan avatar Aug 31 '22 15:08 ctrlaltdylan

Oh, yes or it sounds like we may want to configure an apphook to make this work more seamlessly. I'll run this by eng to make sure my understanding is correct.

Good catch @dangub!

dannyroosevelt avatar Aug 31 '22 21:08 dannyroosevelt