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:
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.
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.
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
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
@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:
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 ?
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.
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
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