Register a Webhook in Dynamics 365 using power platform CLI and plugin registration tool
Webhooks allow external systems, such as, Verint adapter to receive notifications for specific events occurring within Dynamics 365. Follow these steps to register a Webhook in Microsoft Dynamics 365 using the Power Platform Command Line Interface (CLI) and the Plugin Registration Tool (PRT).
Before you begin
-
You have administrator access to your Dynamics 365 environment.
-
You have a valid HTTPS endpoint for the Webhook.
-
.NET SDK is installed
-
Power Platform CLI is downloaded.
Procedure
-
Install Power Platform CLI
-
After downloading, locate the installer file:
powerapps-cli-1.0.msi
-
Run the installer to complete the installation.
-
-
Authenticate to your Dynamics 365 environment
-
Open a command prompt.
-
Run the following command:
pac auth create --url https://yourorg.crm.dynamics.com
-
Sign in with you credentials when prompted.
-
-
Launch the plugin registration tool.
-
In the command prompt, run:
pac tool prt
-
This opens the Plugin Registration Tool interface.
-
In the tool, go to Register and select Register New WebHook.
-
-
Configure the Webhook
-
Enter the Endpoint URL where the Verint adapter is listening.
-
Select the appropriate Authentication Type.
For this integration, choose
HttpHeader
. -
Add a custom header:
-
Header name:
Verint-Header
-
Header value:
Test
Webhook events will not be triggered without authentication.The receiving adapter must validate both the authentication header and the organization information.
-
-
-
Validate incoming events headers
The Verint adapter verifies the following headers in each incoming event:
Authentication header:
Verint-Header: Test
Organization header:
x-ms-dynamics-organization: ris-crm-sandbox.crm.dynamics.com
If either header is missing or does not match the expected values, the event should be discarded.
-
Define Webhook steps
Add steps to specify which entity operations should trigger notifications.
Entity
Operation
msdyn_ocliveworkitem
Create, Update
msdyn_ocsession
Create, Update
These steps ensure the Verint adapter receives relavant data from screen recording.
-
Apply attribute-level filters
To reduce unneccessary events traffic, apply filters to limit notifications to specific attributes.
Entity
Operation
Filtering Attributes msdyn_ocsession
Create
All Attributes msdyn_ocsession
Update
activityid, msdyn_agentacceptedon, msdyn_agentassignedon, msdyn_closurereason, msdyn_liveworkitemid, ownerid, owningteam, msdyn_sessionid, msdyn_stateignedon_ mydyn_state
msdyn_ocliveworki
Create
All Attributes msdyn_ocliveworki
Update
msdyn_activeagentid, actualend, actualstart, msdyn_createdon, msdyn_ocliveworkitemid, msdyn_initiatedon, msdyn_isabandoned, msdyn_isagentaccepted, msdyn_isagentsession, msdyn_lastsessionid, ownerid, statecode, msdyn_liveworkstreamid, msdyn_wrapupinitiatedon
You can modify the filtering attributes as needed to support additional intergration requirements.
What to do next