{"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-25T17:20:59","modified_gmt":"2021-03-25T17:20:59","slug":"working-with-the-web-hook-node","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-0\/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, 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=\"Create_and_Register_an_App\">Create and Register 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 in the <b>Settings<\/b> tab of your Bot. For more information, refer to <a href=\"\/docs\/bots\/bot-builder\/editing-an-existing-bot\/sdk-configuration\/\">SDK Configuration<\/a>.<\/p>\n<ol>\n<li>On the left pane, click <b>API Extensions<\/b>.\u00a0By default, the BotKit SDK tab is displayed.<\/li>\n<li>Click <strong>Agent Transfer<\/strong>.<\/li>\n<li>On the Agent Transfer page, click <strong>Add<\/strong> next to the <strong>App Name<\/strong> drop-down list.<\/li>\n<li>On the <strong>Create Client App <\/strong>window, enter the app name in the <strong>Name<\/strong> field. For example, SDK App.<\/li>\n<li>Click <strong>Next<\/strong>.<\/li>\n<li>The <strong>Client ID<\/strong> and <strong>Client Secret<\/strong> are generated along with the <em>App Created Successfully<\/em> message.<\/li>\n<li>Click <strong>Done<\/strong>.<\/li>\n<li>In the <strong>Callback URL<\/strong> field, enter the URL for your application that you want Kore.ai to push data to. For example, https:\/\/koremessenger.com\/postURL.<br \/>\n<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.<\/li>\n<li>Under the <strong>PII Data<\/strong> section, define how <strong>sensitive information<\/strong> should be handled. If there is a need to share unmasked data when an agent session is in progress, even when <a href=\"\/docs\/bots\/bot-settings\/pii-data-masking\/\">PII redaction is enabled<\/a>, select the <em>Do not mask and send original data to Agent BotKit<\/em>. Else, go with the default setting of <em>Mask and send sensitive data to Agent BotKit.<\/em><\/li>\n<li>Under the <strong>Access Using a Connector<\/strong> section, indicate if your URL is behind a firewall and a <strong>Connector<\/strong> has to be used.<\/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=\"Set_Up_the_WebHook_Node\">Set 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=\"Add_a_WebHook_Node_to_the_Dialog_Task\">Add a WebHook Node to the Dialog Task<\/span><\/h3>\n<ol>\n<li><span style=\"font-weight: 400\">Open the dialog task to add the <\/span>WebHook node.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Click the <strong>+<\/strong> <\/span><span style=\"font-weight: 400\">icon next to the respective node.<\/span><\/li>\n<li>Select <b>Intent <\/b>&gt;<b> New WebHook Node<\/b>.<\/li>\n<li><span style=\"font-weight: 400\">On the WebHook window, by default, the <strong>Component Properties<\/strong> tab is displayed.<\/span><\/li>\n<li><span style=\"font-weight: 400\">Enter a <strong>Name<\/strong> and <strong>Display Name<\/strong> for the node.<\/span><\/li>\n<li>The other settings are auto-filled based on your Agent Transfer SDK configuration. Go to <b>API Extensions<\/b> to modify any settings.<\/li>\n<li>In the <strong>Variable Namespaces<\/strong> section (introduced in v8.0), associate the Variable Namespaces to execute this node and its transitions. This option is visible only when the Variable Namespace is enabled for the bot. You can go with the task level settings or customize it for this node. For more information, refer to <a href=\"\/docs\/bots\/bot-settings\/bot-management\/managing-namespace\/\" target=\"_blank\" rel=\"noopener noreferrer\">Managing Namespace<\/a>.<\/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=\"Configure_the_Connections_Properties\">Configure the Connections Properties<\/span><\/h3>\n<p>You can add <em>If-Else<\/em> operators in the node\u2019s <strong>Connections<\/strong> tab 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 set up Component Transitions, follow the below steps:<\/p>\n<ol>\n<li>Click the <strong>Connections<\/strong> tab.<\/li>\n<li>On the Connections tab, under the <strong>Connection Rules<\/strong> section, 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: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, and less than. Select the entity, operator using the respective drop-down lists, and type the number in the <b>Value <\/b>box. For 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: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, and less than. For example,<b>\u00a0<\/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 matches 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<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol>\n<div class=\"alert alert-info\"><b>Note<\/b>: If you want to write multiple <em>If<\/em> conditions, click <strong>Add Else<\/strong> <strong>If<\/strong> below the last <em>If<\/em> 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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<div class=\"w-post-elm post_navigation layout_simple inv_false\">\n\t<a class=\"post_navigation-item order_first to_prev\" href=\"https:\/\/developer.kore.ai\/v8-0\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-agent-transfer-node\/\"><\/p>\n<div class=\"post_navigation-item-arrow\"><\/div>\n<div class=\"post_navigation-item-meta\">Previous<\/div>\n<div class=\"post_navigation-item-title\"><span>Agent Transfer Nodes<\/span><\/div>\n<p>\t<\/a><br \/>\n<a class=\"post_navigation-item order_second to_next\" href=\"https:\/\/developer.kore.ai\/v8-0\/docs\/bots\/bot-builder-tool\/dialog-task\/grouping-nodes\/\"><\/p>\n<div class=\"post_navigation-item-arrow\"><\/div>\n<div class=\"post_navigation-item-meta\">Next<\/div>\n<div class=\"post_navigation-item-title\"><span>Grouping Nodes<\/span><\/div>\n<p>\t<\/a><\/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\/v8-0\/wp-json\/wp\/v2\/posts\/17959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/comments?post=17959"}],"version-history":[{"count":7,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/17959\/revisions"}],"predecessor-version":[{"id":26379,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/17959\/revisions\/26379"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/media?parent=17959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/categories?post=17959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/tags?post=17959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}