APIs & Integrations

MikeTurnbull
Member

Webhook and Azure Functions

SOLVE

Hi,

I am attempting to use an Azure function as the endpoint for a HubSpot webhook. Here are the steps I have taken:

In HubSpot Development:

  1. I created an app "myApp"
  2. I created a Test Hub
  3. I went through the OAuth2.0 Flow using the Postman app to install my app as an integration in my Test Hub.
  4. I when back to my app "myApp" and created a new webhook subscription that fires when a deal is created. I passed in the function url from my Azure function as my webhook URL and made sure my subscription is 'active'
  5. I created a new deal in my Test Hub.
  6. I went back to my "myApp" and selected 'webhook logging' and saw several logs all showing an HTTP of 400 and a status of failure.
  7. Finally I went to my Azure Function and the logs show that the function is firing but the function is not able to retrieve any data from the JSON payload sent by the webhook.

Has anyone else done this successfully? Any ideas?

Many thanks
Mike

0 Upvotes
1 Accepted solution
MikeTurnbull
Solution
Member

Webhook and Azure Functions

SOLVE

Hi Derek, thanks for your help. My function is Node.js, and it turns out the JSON payload from HubSpot is wrapped in an array. So instead of querying data.eventId, I had to query data[0].eventId.

All working now :slight_smile:

Thanks again
Mike

View solution in original post

4 Replies 4
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Webhook and Azure Functions

SOLVE

Hi @MikeTurnbull,

That would do it; thanks for updating the topic with your solution!

0 Upvotes
MikeTurnbull
Solution
Member

Webhook and Azure Functions

SOLVE

Hi Derek, thanks for your help. My function is Node.js, and it turns out the JSON payload from HubSpot is wrapped in an array. So instead of querying data.eventId, I had to query data[0].eventId.

All working now :slight_smile:

Thanks again
Mike

MikeTurnbull
Member

Webhook and Azure Functions

SOLVE

Thanks Derek, I'll have a play and let you know :slight_smile:

Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Webhook and Azure Functions

SOLVE

Hi @MikeTurnbull,

Based on some quick research (i.e. Google) I found a couple examples of similar situations (see below). Have you added reference to NewtonSoft.JSON?

0 Upvotes