Webhook Not Working


#1

I would like to get alerts when a contact firstname changes.

Rather than polling the api, I would like to use a webhook to send me the data when it changes.

I went to the developer console and created an app.

I then subscribed to the trigger for contacts having firstname changes and pointed that to my url.

As for that url, I created a very simple web service that takes in the resulting json thats supposedly received from the webhook and sends me that data as an email.

Problem is that the console shows me just 0's, no trigger action whatsoever. Am i missing something? Does my web api have to do something else? Can you provide detailed instructions?

When i tested the subscription it worked...interestingly the data was null though? So it may be failing...what needs to be done?


#3

Hi @pharr,

Did you install your app to your production account? Before any webhook notifications are sent, your app must be added to your HubSpot account. You can check whether or not it's installed by navigating to the 'Integrations' page of your production HubSpot account.

If it hasn't yet been installed, you can accomplish that by completing the OAuth flow described in the following developer doc:


#4

Thanks so much for your help, its all set up and working...one last point i see that access tokens expire every 6 hours, and id need to send a refresh token to keep it alive... is this automatically refreshed or i have to manually send refresh requests every 6 hours?!


#5

Hi @pharr,

If you're using the access tokens to make requests to the HubSpot API, you need to refresh the tokens when they expire every 6 hours. However, if you're only installing your app in order to receive webhooks, you can ignore the access token(s) and just listen for the webhook notifications.

HubSpot's authentication matches the OAuth 2 spec; for more info on OAuth 2, check out the following info:


#6

Thank you very much for all you help!