APIs & Integrations

gotmike
Top Contributor

Using Webhook / Deal Property Changed - Deal Stage

I’m trying to use the UI to set up a webhook that will trigger on a change in the Deal Stage.

I have setup to monitor the following:

Object: Deal
Event: propertyChange
Property Name: Deal Stage

and also tried…

Object: Deal
Event: propertyChange
Property Name: dealstage

Neither is triggering when I drag a deal to a new stage or even if I open the deal manually and set the deal to a different stage.

Both subscriptions are active, and the “test” webhook works properly. I’m using Zapier if that matters to catch the hook.

Any idea what could cause them to not be triggered? How can I fix?

0 Upvotes
31 Replies 31
3PETE
HubSpot Employee
HubSpot Employee

Using Webhook / Deal Property Changed - Deal Stage

@cre
Yes, you can use postman to finish off this flow. Once you receive the code you then have to make the call to the next(and final) endpoint in oauth.

This is part of a normal Oauth2 flow. Passport handles all of this for you. My apologies if it was coming across as to complicated or overly-complicated. Here is an example of a call in postman in addition to the docs I linked above.

and the headers

0 Upvotes
gotmike
Top Contributor

Using Webhook / Deal Property Changed - Deal Stage

okay, i get that you are doing all this for an app that is installed somewhere. for that use case, the oauth 2.0 logic makes sense to me fine.

but here, i’m ONLY trying to trigger webhooks.

i have NO code at all to process anything.

so… when i follow the instructions on your oauth 2.0 page, my callback is really hubspot itself, no?

so my URL is correct, right?

https://app.hubspot.com/oauth/authorize?client_id=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&scope=contact... (X’s replace real data)

and after going to that and authorizing, i get redirected to the following URL:

https://www.hubspot.com/?code=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX (X’s replace real data)

presumably, the querystring “code” is the “token” to be used for future calls… IF i was writing an app that needed a token.

but, i’m not making any calls at all. in fact, there are no inbound, external calls at all to the hubspot system. this is literally only to entice hubspot to make an external, outbound call to another system once triggered.

this webhook idea is extremely helpful to us, if we can get it to work, b/c right now we have to poll hubspot frequently to find out when deals are moved between stages to trigger workflows in different areas.

but it is starting to sound like you didn’t really intend on just supplying the pure webhook functionality, but instead meant it to be part of some other app ecosystem? maybe our use case just isn’t supported yet?

all i want is to be able to trigger a webhook every time a deal is moved from one stage to another. maybe there’s a simpler way and i jumped in a bit too deep at the beginning?

3PETE
HubSpot Employee
HubSpot Employee

Using Webhook / Deal Property Changed - Deal Stage

@cre I do not have a full app. I am just referring to the oauth flow of how to install your hubspot dev app that contains your webhook. I am sorry if you do not find this user friendly. Also the “code” is not the token which you are right you do not need. Your use case is most definitely supported but you will need to write some code to pull it off.

0 Upvotes
gotmike
Top Contributor

Using Webhook / Deal Property Changed - Deal Stage

Remember, I’m not trying to create a full-featured app in this scenario, I really ONLY need to be able to trigger webhooks.

3PETE
HubSpot Employee
HubSpot Employee

Using Webhook / Deal Property Changed - Deal Stage

@cre When I go through an app install for ex., I write it in NodeJS. I use passport as the middle ware which allows you to create a hubspot strategy in which you can pass along the secret with the ID.

I’ve also posted some example code in a previous post on the forum.

0 Upvotes
gotmike
Top Contributor

Using Webhook / Deal Property Changed - Deal Stage

I don’t see any instructions on how to pass the client secret on the page you referenced above. How is this done?

gotmike
Top Contributor

Using Webhook / Deal Property Changed - Deal Stage

okay… so i am using the following URL:

https://app.hubspot.com/oauth/authorize?client_id=[CLIENT-ID]&scope=contacts&redirect_uri=https://ww...

the app is setup to use the following scope: Read from and write to my Contacts

i have authorized the app in both a test/trial portal AND our production portal (low risk since i’m just sending a webhook)

the app still shows zero installs and is not triggering any webhooks.

also, i cannot find out where to “de-authorize” the app or any indication that the app is installed in my instance. is there somewhere i can look to confirm this and/or de-authorize?

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Using Webhook / Deal Property Changed - Deal Stage

If it says there are no installs then you must not have set up the oauth connection correctly to install it. When you make the connection you would need to pass the client secret along as well.

0 Upvotes
gotmike
Top Contributor

Using Webhook / Deal Property Changed - Deal Stage

i have not! this is just supposed to be an internal app for our own use. i cannot find any documentation on how to implement the solution this way. how do i install in a dev app, and then (more importantly) can i install in our own production instance, or once it’s produced does it have to be released to the entire world?

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Using Webhook / Deal Property Changed - Deal Stage

@cre You can install in in a test portal or your production portal. No it does not have to be released to the entire world. No one else would have your client ID or secret to be able to install it anyways. Here are some docs on our oauth 2.0 set up. You will need to use oauth to install it and log in to which hubspot portal you wish to install it into.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Using Webhook / Deal Property Changed - Deal Stage

@cre Have you installed the app into the portal you wish to watch? Because dev portals can be used for multiple instances of HubSpot you need to install it into which portal/instance you want to watch.

0 Upvotes