{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":21555,"path":"integrate-applications/integration-hub/setup-plivo-webhook.md","title":"Set up a bi-directional webhook for the Plivo spoke","bundle":null,"doc_type":null,"release":"australia","body":"\n# Set up a bi-directional webhook for the Plivo spoke\n\nConfigure a webhook to subscribe to your Plivo account with a ServiceNow callback URL.\n\n## Before you begin\n\n-   Request Integration Hub subscription.\n-   Activate the Plivo spoke.\n-   [Set up the Plivo spoke](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/plivo-setup.md)\n-   Role required: sn\\_plivo\\_spoke.Plivo\\_Admin and decision\\_table\\_admin.\n\n## Register a Plivo webhook in ServiceNow\n\nRegister a Plivo webhook in your ServiceNow instance to notify the ServiceNow app when certain events occur in Plivo.\n\n### Before you begin\n\nRole required: sn\\_plivo\\_spoke.Plivo\\_Admin and decision\\_table\\_admin\n\n### Procedure\n\n1.  Navigate to **All** &gt; **Plivo Spoke** &gt; **Plivo Webhook Registries**.\n\n2.  Click **New**.\n\n3.  On the form, fill in the fields.\n\n    |Field|Description|\n    |-----|-----------|\n    |Name|Unique name to identify the record. For example, `Plivo webhook`.|\n    |Description|Description of the record.|\n    |Path|Plivo webhook path. By default, this path is set to `api/sn_plivo_spoke/plivo_webhook_handler/wh_entry`.|\n\n4.  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### Result\n\nThe Plivo webhook is registered in your ServiceNow instance.\n\n## Add a callback URL in Plivo\n\nProvide a webhook callback URL in your Plivo account to create a webhook.\n\n### Before you begin\n\nRole required: sn\\_plivo\\_spoke.Plivo\\_Admin and decision\\_table\\_admin\n\n### Procedure\n\n1.  Log in to your Plivo console.\n\n2.  Create an application in the Plivo console as per your requirement.\n\n    For more information about creating an application in the Plivo console, see the Create an Application section in the [Make your first Outbound Call](https://www.plivo.com/docs/voice#make-your-first-outbound-call) page of the [Plivo documentation](https://www.plivo.com/docs/). You can also refer to the [Plivo Application documentation](https://www.plivo.com/docs/account/api/application/) for more information about creating and updating an application using Plivo APIs.\n\n3.  Enter the webhook callback URL in **MESSAGE URL** and **ANSWER URL**, and configure the application as per your requirement.\n\n\n### Result\n\nThe callback URL is added in your Plivo account. You can create routing policies and subflows as per your requirement. See [Create routing policy and customize webhook](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/setup-plivo-webhook.md) for information regarding the creation of new routing policies and subflows.\n\n## Create routing policy and customize webhook\n\nCreate a webhook routing policy and subflow as per your requirement.\n\n### Before you begin\n\nRole required: sn\\_plivo\\_spoke.Plivo\\_Admin and decision\\_table\\_admin\n\n### About this task\n\nRouting policy in the Plivo WebHook Routing Policy module triggers the subflows and notifies the ServiceNow instance when certain events occur in your Plivo account. See [Plivo Spoke](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/plivo-spoke.md) 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 the default subflow.\n\n    Two subflows are available along with Plivo spoke; Plivo Call Handler and Plivo SMS Handler. You can create a copy of either of these subflows as per your requirement.\n\n4.  Customize the subflow as per 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 [Plivo Spoke](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/plivo-spoke.md) for information about the supported fields.\n\n5.  Navigate to **Plivo Spoke** &gt; **Plivo WebHook Routing Policy**.\n\n6.  Click **New**.\n\n7.  On the form, fill in the fields.\n\n<table id=\"table_awj_xgv_z3b\"><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 Plivo.\n\n</td></tr><tr><td>\n\nAnswer\n\n</td><td>\n\nSubflow that must be triggered when the specified conditions are met.\n\n</td></tr></tbody>\n</table>    Routing policies and subflows support these Plivo fields:\n\n    -   Keywords\n    -   Call Event\n    -   Caller Name\n    -   Event Type\n    -   SMS Text\n    -   To Number\n    -   Show Related Fields\n8.  Click **Submit**.\n\n    **Note:** These routing policies are saved in the Decision tables. Users are cautioned against directly updating or modifying data in these tables.\n\n\n### Result\n\nThe routing policy and subflow are created.\n\n"}}