web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Registering a Webhook on Deal close using the Web API

(0) ShareShare
ReportReport
Posted on by

Hello,

I am trying to register a Webhook using the Web API that triggers on an Opportunity being Closed Won. I have found documentation to do that via some Plugin Tool but I would like the step to be automatic in our workflow. So far googling Dynamics 365 and Webhooks has only returned that Plugin Tool and this Stack Overflow post. In that post the answer mentions a CRM REST Builder tool, that tool seems to be discontinued and was removed from github, a new tool seems to have been made called Dataverse REST Builder, I downloaded that but so far have not seen any mention of Webhooks in it. 

Is it even possible to register a webhook programmatically or does it have to be done manually every time via that Plugin Tool?

Thanks for any help you might be able to provide.

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Registering a Webhook on Deal close using the Web API

    Ah looks like Dynamics just doesn't like ngrok for some reason. RequestBin seems to work fine though!

    It looks like an Async Webhook Step is best though to prevent errors that stop Users from saving items which is good to know as well.

    Thanks again for your help man I really appreciate it!

  • Guido Preite Profile Picture
    54,084 Moderator on at
    RE: Registering a Webhook on Deal close using the Web API

    difficult to know what's going wrong from your side.

    Ivan Ficko wrote a series of post about web hooks a while ago:

    dynamicsninja.blog/.../

    dynamicsninja.blog/.../

    dynamicsninja.blog/.../

    maybe inside one of these posts you can find some idea on how to debug your webhook

    hope it helps

  • Community Member Profile Picture
    on at
    RE: Registering a Webhook on Deal close using the Web API

    Ah ok the Create makes sense, I was taking it as Updating of an Opportunity by mistake.

    Well I got a little further after I updated my step to be on Create of Account!

    I now get this error when attempting to create an Account haha, so...progress!

    "Microsoft Dynamics 365 can’t complete your request. The webhook service endpoint may be configured incorrectly or is not available. Contact the service endpoint owner or your system administrator to validate your configuration. If the problem persists, contact Microsoft Dynamics 365 customer support for help."

    I tried changing the Webhook Step to Async and it worked but the Webhook never fired.

    Ah yes I have ngrok all configured on my end, I used it heavily when doing this for Hubspot a while back. :) 

  • Guido Preite Profile Picture
    54,084 Moderator on at
    RE: Registering a Webhook on Deal close using the Web API

    probably for your scenario the message will be create of opportunityclose (as dynamics creates an opportunity close record when the opportunity is won) but you can test with a simpler message (like create of an account or contact to see if the webhook configuration is ok)

    regarding ngrok, if you use their online service the address is public so no problems, a local version of ngrok need to be configured with a custom public domain in order to be reachable from dynamics (sorry if I wrote something obvious for you regarding ngrok)

  • Community Member Profile Picture
    on at
    RE: Registering a Webhook on Deal close using the Web API

    Ah that makes much more sense that it all cannot be done in Dynamics and does indeed require the tool. Thank you so much!

    So I have created my webhook and I created a step  which I believe should fire on opportunity close (I dont see any options to set if it's closed won or lost).

    Does this seem correct to yopastedimage1665692158096v1.pngu? (I have it setup in ngrok and am going to test it quick).

  • Verified answer
    Guido Preite Profile Picture
    54,084 Moderator on at
    RE: Registering a Webhook on Deal close using the Web API

    I understand it can be complicated for a developer facing it the first time. I try to explain as simple as possible.

    Let's say you want to notify url mycustomdomain[dot]com every time a new account is created, for this scenario you can use a webhook.

    You register the webhook using the Plugin Registration Tool, probably you already found this page learn.microsoft.com/.../use-webhooks it can be confusing

    if you saw the button "How to register endpoints" you are probably using the classic interface, there you will see the button "add existing" and you can add there the webhook you created earlier.

    in this way the webhook is added to the solution, if the solution is moved to another environment, the webhook is included.

    I attached a screenshot, hope it helps

    6521.screens.png

  • Community Member Profile Picture
    on at
    RE: Registering a Webhook on Deal close using the Web API

    Thanks for the response. I see service endpoints in the managed package customizations but unfortunately there doesn't appear to be a way to add them. I see one existing called IoT Message but the create button is just a link called "How To Register Endpoints" that just links out to documentation about SDK Message entities and doesn't actually explain how to register anything.

    I do see SDK Message Processing steps but there is also no way to make that in the solution explorer. The documentation there just also points to using the Plug-in Registration tool. It's looking like I will need to go learn that tool as well if I want to do much of anything unfortunately.

    I may have jumped the gun so to speak in even asking about webhooks as it appears there are several things I need to configure and add before even attempting to register one.

  • Guido Preite Profile Picture
    54,084 Moderator on at
    RE: Registering a Webhook on Deal close using the Web API

    you can also create a managed solution (the concept is similar ot the managed package of Salesforce) that if installed will add the webhook, the webhook needs to be added to the solution after has been registered with PRT to the environment where your unmanaged (source) solution is created

  • Community Member Profile Picture
    on at
    RE: Registering a Webhook on Deal close using the Web API

    I want to register one per customer that integrates with our tool. Generally for other CRMs there is an easy way to just register a webhook to let us know if a deal (opportunity) is moved into the Closed Won stage so we can go grab the information about it.

    We usually register these webhooks in other systems right after the User authenticates the 3rd party tool, in this case Dynamics. Though in other systems like Salesforce we have had to use a managed package to do that before.

  • Guido Preite Profile Picture
    54,084 Moderator on at
    RE: Registering a Webhook on Deal close using the Web API

    the stackoverflow link has the information you need, to register a webhook you need to create a record against the serviceendpoint entity.

    I never tried myself but that link shows that is possible.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 156

#2
DAnny3211 Profile Picture

DAnny3211 89

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans