APIs & Integrations

Sanjeewa_Dias
Participant

Handle Webhook Request

SOLVE

I encountered a scenario where I needed to capture a change in a property value within a Quote Line Item field (e.g., Margin), and update a corresponding property in the associated Deal record based on some calculations.

To address this, I implemented the following workaround:

1. Created a webhook to detect changes in the Line Item property.


2. Developed a Node.js application to process the webhook's POST requests and hosted it on a third-party platform (Heroku).

3. Utilized standard HubSpot APIs in Node app to fetch the relevant data from HubSpot and update the corresponding field.

I would like to know if this workaround is an appropriate approach to handle the described scenario.

Do you have any suggestions for improvement or alternative solutions?

0 Upvotes
1 Accepted solution
zach_threadint
Solution
Guide

Handle Webhook Request

SOLVE

Hi @Sanjeewa_Dias 👋

 

That solution sounds good to me 👍

 

A couple of tips regarding HubSpot APIs and webhooks:

  1. You might like to consider using an established HTTP requests library (e.g. Python's 'requests' or Node's 'axios') to interact with HubSpot's APIs (rather than using a HubSpot API Client Library). The client libraries have many known issues, especially with documentation and backwards comptability.
  2. Always validate your incoming requests to ensure they originate from HubSpot.

I hope that proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


View solution in original post

4 Replies 4
zach_threadint
Solution
Guide

Handle Webhook Request

SOLVE

Hi @Sanjeewa_Dias 👋

 

That solution sounds good to me 👍

 

A couple of tips regarding HubSpot APIs and webhooks:

  1. You might like to consider using an established HTTP requests library (e.g. Python's 'requests' or Node's 'axios') to interact with HubSpot's APIs (rather than using a HubSpot API Client Library). The client libraries have many known issues, especially with documentation and backwards comptability.
  2. Always validate your incoming requests to ensure they originate from HubSpot.

I hope that proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


Sanjeewa_Dias
Participant

Handle Webhook Request

SOLVE

Hi @zach_threadint 👋,

Thank you for your prompt reply and the helpful tips!
I have a few additional queries:

  1. Is there a dedicated hosting platform for HubSpot-specific app hosting?
  2. Do you have suggestions for hosting platforms? (e.g., Heroku, etc.)

Looking forward to your insights!

Thanks,
Sanjeewa.

zach_threadint
Guide

Handle Webhook Request

SOLVE

Hi @Sanjeewa_Dias 👋

 

No problem, happy to help 🙂

 

In response:

  1. Not really. Sometimes it's possible to handle this kind of use case via HubSpot's "Serverless functions" feature. But it's not really designed for that. I generally recommend hosting outside of HubSpot for these kinds of use cases.
  2. I work mostly with Google Cloud Run (either via a "service" or a "function"). I find it works well and is generally cost effective.

Hope that helps.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes
Sanjeewa_Dias
Participant

Handle Webhook Request

SOLVE

Thank you @zach_threadint .
Appreciate your insights on this.