{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":21549,"path":"integrate-applications/integration-hub/setup-onedrive-webhooks.md","title":"Set up a bi-directional webhook for the Microsoft OneDrive spoke","bundle":null,"doc_type":null,"release":"australia","body":"\n# Set up a bi-directional webhook for the Microsoft OneDrive spoke\n\nConfigure a webhook to subscribe to OneDrive with a ServiceNow callback URL.\n\n## Before you begin\n\n-   Request an Integration Hub subscription.\n-   Activate the Microsoft OneDrive spoke.\n-   Role required: admin.\n\n## Register a OneDrive webhook in ServiceNow\n\nRegister a OneDrive webhook in ServiceNow to notify the ServiceNow app when certain events occur in OneDrive.\n\n### Before you begin\n\nRole required: admin.\n\n### Procedure\n\n1.  Navigate to **All** &gt; **Microsoft OneDrive Spoke** &gt; **OneDrive Webhook Registries**.\n\n2.  Click **New**.\n\n3.  On the form, fill in the fields.\n\n<table id=\"table_rzb_htl_fpb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nUnique name to identify the record. For example, `OneDrive webhook`.\n\n</td></tr><tr><td>\n\nDescription\n\n</td><td>\n\nDescription of the record.\n\n</td></tr><tr><td>\n\nPath\n\n</td><td>\n\nOneDrive path. By default, this path is set to `api/sn_onedrive_spoke/onedrive/subscription`\n\n</td></tr><tr><td>\n\nSecret Key\n\n</td><td>\n\nSecret key for accessing OneDrive webhook. **Note:** The **Secret Key** field value is auto-populated when the webhook registry record is saved.\n\n</td></tr></tbody>\n</table>4.  Right-click the form header and click **Save**.\n\n5.  Click **CallBack URL**.\n\n    The system displays the webhook callback URL.\n\n6.  Copy and record the webhook callback URL.\n\n\n## Customize OneDrive bi-directional webhook\n\nCreate a webhook routing policy and subflow according to your requirement.\n\n### Before you begin\n\nRole required: admin\n\n### About this task\n\nRouting 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.\n\n### Procedure\n\n1.  Navigate to **All** &gt; **Flow Designer** &gt; **Designer**.\n\n2.  Click **Subflows**.\n\n3.  Create a copy of any of the default subflows, for example, Sync Changes.\n\n4.  Customize the subflow according to your requirement and publish it.\n\n    See [Building subflows](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/subflows.md) for more information about creating and using subflows, and [OneDrive spoke v1.6](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/onedrive-spoke.md) for information about the supported subflows.\n\n5.  Navigate to **Microsoft OneDrive Spoke** &gt; **OneDrive Webhook Routing Policy**.\n\n6.  Click **New**.\n\n7.  On the form, fill in the fields.\n\n<table id=\"table_yvd_g5r_fpb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nLabel\n\n</td><td>\n\nUnique label to identify the routing policy.\n\n</td></tr><tr><td>\n\nDefault answer\n\n</td><td>\n\nOption to specify if this is the default answer. The default answer is applicable when the conditions are not met.1.  Click the lookup icon \\(\\[Omitted image \"lookup-icon.png\"\\] Alt text: Lookup icon\\).\n2.  Select the required subflow from the Document list.\n\n**Note:** Ensure that the Table name is `Flow [sys_hub_flow]`.\n\n</td></tr><tr><td>\n\nCondition\n\n</td><td>\n\nConditions to be met when the required events occur in OneDrive.\n\n</td></tr><tr><td>\n\nAnswer\n\n</td><td>\n\nSubflow which is triggered when the specified conditions are met.\n\n</td></tr></tbody>\n</table>8.  Click **Submit**.\n\n\n### Result\n\nThe routing policy and subflow are created.\n\n"}}