APIs & Integrations

SRajana
Member

Looking for advise on API integration

SOLVE

Hi,

I am looking for an advise on the approach to solve for an issue.

Use case:

When a hubspot object property changes, I need the changes updated to an internal SP site or trigger a PowerAutomate flow.

 

What I have done so far:

  1. I have a webhook and can post the changes to Webhook.site without issues.  But when I point the url to my PowerAutomate (when an http connection is received), and plug this url in my hubspot, I get a 401. I have used api key(private app) and also dev accout client secret but still get a 401 when I 'test' this.
  2. I have  Nodejs code that will make an api call using a private app access token to pull those changes. This works fine but I need to manually run this everytime.

But here are my questions:
1) What is the best way for my webhook to push changes to either SP or PowerAutomate in terms of authentication. Looking for an example 

 

2) Are there better ways to solve for this?

 

As this internal to my org and from a single app, assuming I would not need to use oAuth.

 

Appreciate your help !

Thx,

Satish

0 Upvotes
1 Accepted solution
zach_threadint
Solution
Guide

Looking for advise on API integration

SOLVE

Hi @SRajana 👋

 

You might like to consider using HubSpot Webhook Subscriptions for this use case (via Private Apps). See this documentation: https://developers.hubspot.com/beta-docs/guides/apps/private-apps/overview

 

In response to the additional context you've supplied, the "Authentication type" option in HubSpot Workflows (specifically for the webhook action type) is intended solely to be used for external system authentication. The way you handle this authentication will be entirely dependent on your external system (e.g. if your external system does not require any form of request authentication, you won't need to set the "Authentication type" in your HubSpot Workflow).

 

HubSpot does offer a request validation security feature, which effectively allows your external application to "validate" the given request originated from HubSpot. This works for webhooks from workflow and webhook subscriptions (via Private App), so you'll likely want to consider using this feature too.

 

I hope this 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

0 Upvotes
4 Replies 4
zach_threadint
Guide

Looking for advise on API integration

SOLVE

Hi @SRajana 👋

 

Can you please offer a bit more detail relating to the 401 error response you're currently receiving? Specifically, which system is responding with this 401 status code and in what context? Maybe some screenshots or more detail around any API calls you're making would help here.

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.


SRajana
Member

Looking for advise on API integration

SOLVE

@zach_threadint I am basically looking for ways to solve for automatically push changes to specific properties to power automate.

 

Here is my setup in Hubspot, where I have added my url from PA ("when an http is received" action). I also

chose my api key to be sent as part of the request headers:

SRajana_0-1731359412698.png

Here my PA flow, and I provided my request body schema from Hubspot.

The issue is here, I was not sure, where I would add any validation of the api key from Hubspot or because this is already generated by Power Automate, it does not need additional validation that this is coming from Hubspot ?

SRajana_1-1731359544219.png

Here is the error in Hubspot:

Server response
 
I do not believe I will need OAuth as this is one application and an internal process.
SRajana_2-1731359906985.png

 

Are there better ways of capturing changes in Hubspot that I can capture but not using zapier or Webhooksite but preferably to Power Automate. Unless I need to create a function in Azure to run an API daily ?. Any examples would help
Appreciate your help !
Thx,
Satish
0 Upvotes
zach_threadint
Solution
Guide

Looking for advise on API integration

SOLVE

Hi @SRajana 👋

 

You might like to consider using HubSpot Webhook Subscriptions for this use case (via Private Apps). See this documentation: https://developers.hubspot.com/beta-docs/guides/apps/private-apps/overview

 

In response to the additional context you've supplied, the "Authentication type" option in HubSpot Workflows (specifically for the webhook action type) is intended solely to be used for external system authentication. The way you handle this authentication will be entirely dependent on your external system (e.g. if your external system does not require any form of request authentication, you won't need to set the "Authentication type" in your HubSpot Workflow).

 

HubSpot does offer a request validation security feature, which effectively allows your external application to "validate" the given request originated from HubSpot. This works for webhooks from workflow and webhook subscriptions (via Private App), so you'll likely want to consider using this feature too.

 

I hope this 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.


0 Upvotes
SRajana
Member

Looking for advise on API integration

SOLVE

@zach_threadint Appreciate your detailed response.

 

In fact I was using a private app authentication. I have also used without authentication but still get a 401. 

I need to look at the network traffic to see what is being sent over to Power Automate.

 

I will check the links that you provided and reach out to you.

 

Thanks again !

Satish