This post will be helpful for those who already have some idea about the use of service end point in Dynamics CRM/365.
What is WebHooks?
WebHooks is a lightweight HTTP pattern for connecting Web APIs and services with a publish/subscribe model. Webhook senders notify receivers about events by making requests to receiver endpoints with some information about the events.
A WebHooks is a way for an app to provide other applications with real-time information.
A WebHooks delivers data to other applications as it happens, meaning you get data immediately. Unlike typical APIs where you would need to poll for data very frequently in order to get it real-time. This makes web hooks much more efficient for both provider and consumer.
For more detail about WebHooks please visit WebHooks
Use of WebHooks in Dynamics 365
Webhooks enable developers and Independent service vendor’s to integrate Dynamics 365 data with their own custom code hosted on external services. By using the webhook model, you can secure your endpoint by using authentication header or query string parameter keys. This is simpler Azure Service Bus integration, you may currently using.
For more detail about Azure Service Bus integration please visit Azure Service Bus integration
Steps to use of WebHooks in Dynamics 365
- 1. Register a webhook
Use the Plug-in Registration tool to register a webhook. In version 9.x you will get a new option “Register New Web Hook”.
The correct webhook registration authentication option and values to use depend on what the endpoint expects. The owner of the endpoint must tell you what to use. To use WebHooks with Dynamics 365, the endpoint must allow one of the three authentication options
Webhook registrations are stored in the ServiceEndpoint Entity in dynamics 365 with contract value equal to 8.
-
2. Register a step for a webhooks
You can register steps same as plugin registration step, only difference will be you cannot pass any configuration. Both configuration field (secure and unsecure) will be disable.
-
3. Invoke a webhooks from a plugin or workflow activity
Webhook is a kind of service endpoint you can also invoke it without registering a step with a plug-in or workflow activity in the same way you can for an Azure Service Bus endpoint. You need to provide the ServiceEndpointId to the IServiceEndpointNotificationService interface
Plugin Sample to invoke WebHooks
Workflow sample to invoke WebHooks
feel free to contact me in case of any query or help.
Send me your queries at arif.manit@gmail.com