{"id":17959,"date":"2016-12-09T21:59:11","date_gmt":"2016-12-09T21:59:11","guid":{"rendered":"https:\/\/developer.kore.com\/?post_type=docs&#038;p=9252"},"modified":"2021-03-26T08:45:12","modified_gmt":"2021-03-26T08:45:12","slug":"working-with-the-web-hook-node","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-3\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-web-hook-node\/","title":{"rendered":"Working with the WebHook Node"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>You can use the WebHook node to subscribe to a message and WebHook events to capture real-time data from real-time events and show them to the user. You can use the WebHook node for server-side validation, execute business logic, or make backend server API calls. Also, you can use the Kore.ai SDK Tool BotKit to add event handlers and control the messages and WebHook events as required by connecting the WebHook node to a Script node to process the response.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2 id=\"webhook\"><span class=\"ez-toc-section\" id=\"Before_you_Begin_Creating_and_Registering_an_App\">Before you Begin: Creating and Registering an App<\/span><\/h2>\n<p>To get access to WebHook events and use WebHook nodes in your Dialog task, you need to subscribe and configure an app on the <b>Settings<\/b> tab for your Bot. For more information, see <a href=\"\/v7-3\/docs\/bots\/bot-builder\/editing-an-existing-bot\/sdk-configuration\/\">SDK Configuration<\/a>.<\/p>\n<ol>\n<li>Hover over the side navigation panel and click <b>Apps &amp; Agents<\/b>.<\/li>\n<li>On the Apps &amp; Agents window, click the <b>Agent Transfer<\/b> tab.<\/li>\n<li>From the App Name drop-down list, select an existing app or click <b>Create App.<\/b><\/li>\n<li>In the Create Client App dialog, enter a <b>Name <\/b>for the app, and then click<b> Next.<\/b><\/li>\n<li>The Client Id and Client Secret appear. Click <b>Done<\/b>.<\/li>\n<li>In the <b>Callback URL<\/b> field, enter the URL from your live agent application.\n<div class=\"alert alert-info\"><b>Note<\/b>: The registration app you create is based on the <b>Callback URL<\/b> applicable to all tasks for the bot. While each task can have unique SDK configurations, the <b>Callback URL<\/b> is the same. Create separate bots for separate application <b>Callback URLs<\/b> for live agent transfers.<\/div>\n<\/li>\n<li>Click <b>Save<\/b>. The <i>Successfully subscribed<\/i> message is displayed.<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Setting_up_the_WebHook_Node\">Setting up the WebHook Node<\/span><\/h2>\n<p>Setting up a WebHook node in a Dialog task involves the following steps:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_1_Adding_a_WebHook_Node_to_the_Dialog_Task\">Step 1: Adding a WebHook Node to the Dialog Task<\/span><\/h3>\n<ol>\n<li>Open the dialog task in which you want to add the WebHook node.<\/li>\n<li>Hover over a node next to which you want to add the WebHook node, and click the plus icon on it.<\/li>\n<li>Click the Plus icon that appears after the node, and then select <b>Intent &gt; New WebHook node<\/b>. The Component Properties pane for the entity opens.<\/li>\n<li>Enter a <strong>name<\/strong> for the node.<\/li>\n<li>The other settings are auto-filled based on your Agent Transfer SDK configuration. Got to <b>Apps &amp; Agents<\/b> for changing any settings.<\/li>\n<li><strong>Timeouts<\/strong>\u00a0can be configured by selecting from the range of 1 to 10 minutes. By default, it is set to 4 minutes.<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Step_2_Configuring_the_Connections_or_Transitions_Properties\">Step 2: Configuring the Connections (or Transitions) Properties<\/span><\/h3>\n<p>You can add If-Else operators in the node\u2019s Connections pane to determine which node in the dialog text to execute next. You can write the conditional statements based on the values of any Entity or Context Objects in the dialog task, or you can use intents for transitions.<br \/>\nTo setup Component Transitions, follow these steps:<\/p>\n<ol>\n<li>Hover over the node, and click the icon. The Connections pane opens.<\/li>\n<li>On the Connections pane, click <b>Add IF<\/b>.<\/li>\n<li>Configure the conditional expression based on one of the following criteria:\n<ul>\n<li><b>Entity<\/b>: Compare an Entity node in the dialog with a specific value using one of these operators: <b>Exists<\/b>, <b>equals to<\/b>, <b>greater than equals to<\/b>, <b>less than equals to<\/b>, <b>not equal to<\/b>, <b>greater than<\/b>, and <b>less than<\/b>. Select the entity, operator using the respective drop-down lists, and type the number in the <b>Value <\/b>box. Example: <i>PassengerCount (entity) greater than (operator) 5 (specified value)<\/i><\/li>\n<li><b>Context<\/b>: Compare a context object in the dialog with a specific value using one of these operators: <b>Exists<\/b>, <b>equals to<\/b>, <b>greater than equals to<\/b>, <b>less than equals to<\/b>, <b>not equal to<\/b>, <b>greater than<\/b>, and <b>less than.\u00a0<\/b>Example<b>: <\/b><i>Context.entity.PassengerCount<\/i> <i>(Context object) greater than (operator) 5 (specified value)<\/i><\/li>\n<li><b>Intent: <\/b>Select an intent that should match the next user utterance.<\/li>\n<\/ul>\n<\/li>\n<li>In the <b>Then go to<\/b> drop-down list, select the next node to execute in the dialog flow if the conditional expression succeeds. For example, if the <i>PassengerCount (entity) greater than (operator) 5 (specified value), <\/i><b>Then go to <\/b><i>Offers (sub-dialog).<\/i><\/li>\n<li>In the <b>Else <\/b>drop-down list, select the node to execute if the condition fails.<\/li>\n<\/ol>\n<div class=\"alert alert-info\"><b>Note<\/b>: If you want to write multiple If conditions, click Add Else If below the last If conditional expression.<\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"You can use the WebHook node to subscribe to a message and WebHook events to capture real-time data from real-time events and show them to the user. You can use the WebHook node for server-side validation, execute business logic, or make backend server API calls. Also, you can use the Kore.ai SDK Tool BotKit to...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-17959","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/17959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/comments?post=17959"}],"version-history":[{"count":4,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/17959\/revisions"}],"predecessor-version":[{"id":22303,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/17959\/revisions\/22303"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/media?parent=17959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/categories?post=17959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/tags?post=17959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}