Set up a bi-directional webhook for the Microsoft OneDrive spoke
Configure a webhook to subscribe to OneDrive with a ServiceNow callback URL.
Before you begin
- Request an Integration Hub subscription.
- Activate the Microsoft OneDrive spoke.
- Role required: admin.
Register a OneDrive webhook in ServiceNow
Register a OneDrive webhook in ServiceNow to notify the ServiceNow app when certain events occur in OneDrive.
Before you begin
Role required: admin.
Procedure
Navigate to All > Microsoft OneDrive Spoke > OneDrive Webhook Registries.
Click New.
On the form, fill in the fields.
| Field | Description |
|---|---|
| Name | Unique name to identify the record. For example, `OneDrive webhook`. |
| Description | Description of the record. |
| Path | OneDrive path. By default, this path is set to `api/sn_onedrive_spoke/onedrive/subscription` |
| Secret Key | Secret key for accessing OneDrive webhook. Note: The Secret Key field value is auto-populated when the webhook registry record is saved. |
Right-click the form header and click Save.
Click CallBack URL.
The system displays the webhook callback URL.
Copy and record the webhook callback URL.
Customize OneDrive bi-directional webhook
Create a webhook routing policy and subflow according to your requirement.
Before you begin
Role required: admin
About this task
Routing policies in the OneDrive Webhook Routing Policy module triggers the subflows and notifies the ServiceNow instance when certain events occur in your OneDrive account. See OneDrive spoke for information about the fields that the routing policy and subflows support.
Procedure
Navigate to All > Flow Designer > Designer.
Click Subflows.
Create a copy of any of the default subflows, for example, Sync Changes.
Customize the subflow according to your requirement and publish it.
See Building subflows for more information about creating and using subflows, and OneDrive spoke v1.6 for information about the supported subflows.
Navigate to Microsoft OneDrive Spoke > OneDrive Webhook Routing Policy.
Click New.
On the form, fill in the fields.
| Field | Description |
|---|---|
| Label | Unique label to identify the routing policy. |
| Default answer | Option to specify if this is the default answer. The default answer is applicable when the conditions are not met.1. Click the lookup icon ( Image omitted: lookup-icon.png 2. Select the required subflow from the Document list. Lookup icon). Note: Ensure that the Table name is |
| Condition | Conditions to be met when the required events occur in OneDrive. |
| Answer | Subflow which is triggered when the specified conditions are met. |
- Click Submit.
Result
The routing policy and subflow are created.