{"id":17958,"date":"2016-12-09T14:43:35","date_gmt":"2016-12-09T14:43:35","guid":{"rendered":"https:\/\/developer.kore.com\/?post_type=docs&#038;p=9233"},"modified":"2021-08-04T07:33:41","modified_gmt":"2021-08-04T06:33:41","slug":"working-with-the-service-node","status":"publish","type":"post","link":"https:\/\/multisite.korebots.com\/v9-0\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-service-node\/","title":{"rendered":"Service Node"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row via_grid cols_1 laptops-cols_inherit tablets-cols_inherit mobiles-cols_1 valign_top type_default stacking_default\"><div class=\"wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><p>The Service Node is a component type in a dialog task that you can use to add an API service to make REST or SOAP requests to third-party web services. You can use this node when you have the parameters needed for the API request using an entity or other nodes to capture the user input.<\/p>\n<p>You can define the Service Type as:<\/p>\n<ul>\n<li><strong>Custom Service<\/strong> &#8211;\u00a0Define an API request to a third-party web service. This is the default setting.<\/li>\n<li><strong>HTML to Image<\/strong> &#8211; Define HTML to render as an image using JavaScript. For example, to compose HTML or the value of a key in a web service response that contains HTML markup as a string that you want to convert to an image.<\/li>\n<li><strong>URL to Image<\/strong> &#8211; Define a\u00a0web page URL to load to render an image.<\/li>\n<li><strong>Custom Authentication Service<\/strong> &#8211; Define a URL to a third-party\u00a0application that provides\u00a0the authentication services necessary for the task flow.<\/li>\n<li><strong>Alert Subscription Service<\/strong> &#8211; Define contextually relevant alerts to be sent proactively to the user as a part of the dialog journey.<\/li>\n<li><strong>Data Table Service<\/strong> &#8211; Define CRUD operations to query and manipulate the data for any given data table\/table view assigned to the bot.<\/li>\n<\/ul>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h2><span class=\"ez-toc-section\" id=\"Set-Up\"><\/span>Set-Up<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Setting up a service node in a dialog task involves the following steps:<\/p>\n<p>Note: Post v9.0 of the platform, the Service node is categorized under the Bot Action node. For details on the Bot Action node, <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/bot-action-node\/\" target=\"_blank\" rel=\"noopener noreferrer\">click here<\/a>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Add_Node\"><\/span>Add Node<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>Open the dialog task to add the Service node.<\/li>\n<li>Add service node in the designated place. For steps in adding nodes, <a href=\"\/docs\/bots\/chatbot-overview\/using-the-dialog-builder-tool\/#Adding_Nodes\">refer here<\/a>.<\/li>\n<li>The Service window is displayed with the <strong>Component Properties<\/strong> tab selected by default.<\/li>\n<li>You can configure the <strong>Connection Properties, <\/strong><a href=\"\/docs\/bots\/chatbot-overview\/using-the-dialog-builder-tool\/#Bot_Action_Nodes\" target=\"_blank\" rel=\"noopener noreferrer\">refer here for details<\/a>.<\/li>\n<\/ol>\n<\/div><\/div><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h2><span class=\"ez-toc-section\" id=\"Configure_Node\"><\/span>Configure Node<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li>On the <strong>Component Properties<\/strong> tab, under the <strong>General Settings<\/strong>\u00a0section, enter the <strong>Name<\/strong> and <strong>Display Name<\/strong> of your service node. For example, <span style=\"color: #0000ff;\">FetchWeather<\/span>.<\/li>\n<li>Choose a <strong>Service Type<\/strong> from the drop-down list:\n<ul>\n<li><strong>Custom Service<\/strong> &#8211;\u00a0Define an API request to a third-party web service. This is the default setting.<\/li>\n<li><strong>HTML to Image<\/strong> &#8211; Define HTML to render as an image using JavaScript. For example, to compose HTML or the value of a key in a web service response that contains HTML markup as a string that you want to convert to an image.<\/li>\n<li><strong>URL to Image<\/strong> &#8211; Define a\u00a0web page URL to load to render an image.<\/li>\n<li><strong>Custom Authentication Service<\/strong> &#8211; Define a URL to a third-party\u00a0application that provides\u00a0the authentication services necessary for the task flow. <a href=\"\/docs\/bots\/bot-builder-tool\/develop\/dialog-task\/implementing-custom-authentication\/\">Learn more<\/a>.<\/li>\n<li><strong>Alert Subscription Service<\/strong> &#8211; Define contextually relevant alerts to be sent proactively to the user as a part of the dialog journey.<\/li>\n<\/ul>\n<\/li>\n<li>Based on the service type selected, select the <strong>Type\/Sub Type<\/strong> from the respective drop-down lists or <strong>Auth URL<\/strong>.<\/li>\n<li>Under the <strong>Request Definition<\/strong> section, click <strong>Define Request<\/strong>.<\/li>\n<li>The <strong>Define Request for\u00a0&lt; <em>ServiceXXXX<\/em>\u00a0&gt;<\/strong> dialog is displayed.<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/s3-us-east-2.amazonaws.com\/kore-wordpress\/developer.kore.ai\/wp-content\/uploads\/sites\/22\/20210706120844\/serviceNode_request.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28347\" src=\"https:\/\/s3-us-east-2.amazonaws.com\/kore-wordpress\/developer.kore.ai\/wp-content\/uploads\/sites\/22\/20210706120844\/serviceNode_request.png\" alt=\"\" width=\"1363\" height=\"387\" \/><\/a><br \/>\nDepending on the <strong>Service Type<\/strong> selected, refer to one of the following sections in this topic:<br \/>\nNote: In the case of <em>Custom Authentication Service<\/em>, the <strong>Request Definition<\/strong> section does not apply and you can see a <strong>Response<\/strong> section instead. <a href=\"\/docs\/bots\/bot-builder-tool\/develop\/dialog-task\/implementing-custom-authentication\/\">Learn more.\u00a0<\/a><\/p>\n<ul>\n<li><a href=\"#custom\">Defining a Custom Service<\/a><\/li>\n<li><a href=\"#URL\">Defining a URL to Convert to Image<\/a><\/li>\n<li><a href=\"#HTML\">Defining HTML to Convert to Image<\/a><\/li>\n<li><a href=\"#auto\">Defining Alert Subscription Service<\/a><\/li>\n<li><a href=\"#Define_a_Data_Service\">Defining Data Service<\/a><\/li>\n<\/ul>\n<\/li>\n<li>In the <strong>Variable Namespaces<\/strong> section, 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<li>From the node\u2019s <strong>Connections <\/strong>tab you can determine which node in the dialog task 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. To setup Component Transitions, follow the below steps:\n<ol>\n<li>On the Service window, click the <strong>Connections<\/strong> tab.<\/li>\n<li>On the <strong>Connections<\/strong> tab, under the <strong>Connection Rules<\/strong> section, you can select nodes from the <strong>Default<\/strong> drop-down list.<\/li>\n<li>You can drag and drop an existing service node from the left panel.<\/li>\n<li>To configure a conditional flow, 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<\/ol>\n<div class=\"alert alert-info\"><b>Note:<\/b> If you want to write multiple <em>If<\/em> conditions, click <strong>Add Else If<\/strong> below the last <em>If<\/em> conditional expression.<\/div>\n<p>&nbsp;<\/li>\n<\/ol>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3 id=\"custom\"><span class=\"ez-toc-section\" id=\"Define_a_Custom_Service\"><\/span>Define a Custom Service<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>When you select <strong>Custom Service<\/strong> in the <strong>Service Type<\/strong>, then in the <strong>Sub-Type<\/strong> field, select one of the options:\n<ul>\n<li><strong>REST<\/strong> &#8211; The API web service is using REST services.<\/li>\n<li><strong>SOAP<\/strong> &#8211; The API web service is using SOAP services.<\/li>\n<\/ul>\n<\/li>\n<li>In the <strong>Request\u00a0Definition<\/strong>\u00a0section, click <span style=\"color: #33cccc;\"><strong>Define Request<\/strong><\/span>\u00a0to specify the settings for the web service type.<\/li>\n<li>The <strong>Define Request for &lt; <em>Service Node Name<\/em> &gt;<\/strong>\u00a0dialog is displayed as shown in the following illustration.<\/li>\n<li>In the <strong>Request URL<\/strong> field, in the first field, select the HTTP method used for the request. You can select:\n<ul>\n<li><strong>POST\u00a0<\/strong>\u2013 Used to send data to the server. For example, customer information, file upload, and so forth using HTML forms.<\/li>\n<li><strong>PUT\u00a0<\/strong>\u2013\u00a0Replaces the content\u00a0of the target resource with the content sent.<\/li>\n<li><strong>PATCH<\/strong> \u2013 Appends\u00a0the content\u00a0of an existing target resource with the content sent.<\/li>\n<li><strong>DELETE<\/strong> \u2013 Deletes the content of an existing target resource.<\/li>\n<li><strong>GET<\/strong> \u2013 Returns the content of an existing target resource<\/li>\n<\/ul>\n<\/li>\n<li>In the second field of the <strong>Request URL<\/strong>, specify the URL for the dialog task response to process at Kore.ai. For example, <span style=\"color: #0000ff;\">http:\/\/koremessenger.com\/postURL<\/span>. Add query or path parameters as part of the URL, if required. To use entity node values as parameters, use the following syntax for accessing the <code>Context<\/code> object:\u00a0<span style=\"color: #0000ff;\">https:\/\/myDomain.com\/{{context.entities.topic}}<\/span>\u00a0for the\u00a0<code>context.entities.topic<\/code>. You must use the double brackets <code>{{ context.object }}<\/code>. For more information, refer to <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/context-object\/\">Context Object<\/a>.\n<ol>\n<li>Optionally, click <strong>Show Advanced<\/strong>, and select\n<ul>\n<li><strong>Yes<\/strong>\u00a0in the<strong> Access Using A Connector<\/strong> field if access for Kore.ai Bots is using the Kore.ai connector agent. For more information, refer to <a href=\"\/docs\/bots\/admin-console\/security-control\/security-module-overview\/#connector\">Using the Kore.ai Connector<\/a>.<\/li>\n<li><strong>Yes<\/strong> in the\u00a0<strong>De-Identification of PII Data<\/strong> to redact any sensitive information types that users share with your bots. For more information, refer to <a href=\"\/docs\/bots\/advanced-topics\/bot-settings\/pii-data-masking\/\">Redacting Personally Identifiable Information<\/a><\/li>\n<\/ul>\n<\/li>\n<li>In the <strong>Auth<\/strong> tab, select the type of authorization needed for this service node call, or define a new authorization type if needed. For more information, refer to <a href=\"\/docs\/bots\/advanced-topics\/authorization\/bot-authentication\/\">Setting Up Authentication<\/a>.<\/li>\n<li>In the <strong>Headers<\/strong> tab, specify the headers as key\/value pairs if required to access the specified request URL. \u00a0Authentication headers are auto-generated based on the authorization type specified on the <strong>Auth<\/strong> tab. You need to define any other standard headers. For example, Content-type, Accept, or any custom headers. Headers defined here are only applicable to this service node.<\/li>\n<li>In the <strong>Body<\/strong> tab, select the body content type. You can select:\n<ul>\n<li><strong>application\/x-www-form-urlencoded<\/strong> &#8211; Also known as Multipart\/Form-data, which is an encoding type that allows files to be sent through an HTTP POST request method if you want to allow a user to upload a file from a form. You can add key\/value pairs that are encoded by the Bots platform.<\/li>\n<li><strong>application\/json<\/strong> &#8211; Use JSON to transmit data between the Kore.ai servers and your bot web application. Any JSON is sent with the request without any processing.<\/li>\n<li><strong>application\/xml<\/strong> \u2013 For SOAP services, pass XML payload using POST methods. You can pass entity node values as part of the XML, using the following syntax for accessing the <code>Context<\/code>\u00a0object:\u00a0https:\/\/myDomain.com\/{{context.entities.topic}}\u00a0for the\u00a0<code>context.entities.topic<\/code>. You must use the double brackets\u00a0<code>{{ context.object }}<\/code>. For more information, refer to <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/context-object\/\">Context Object<\/a>.<\/li>\n<\/ul>\n<\/li>\n<li>In the <strong>Test Request<\/strong> tab, click <strong>Test<\/strong> to optionally send your API request URL using the specified Auth type, HTTP headers, and body parameters, if defined. The response is displayed in the text area. Click <strong>Save as Sample Response<\/strong> to save the test response as the sample response for this node.<\/li>\n<li>Click <strong>Save<\/strong> to save the request for the service node and close the <strong>Define Request for &lt; <em>Service Node Name<\/em> &gt;<\/strong>\u00a0dialog.<\/li>\n<\/ol>\n<\/li>\n<li>In the <strong>Sample Response<\/strong> section, optionally click <strong>Add Sample Response<\/strong> to display the <strong>Add Sample Response<\/strong> dialog that you can use to manually enter or paste a sample response.<\/li>\n<li>Optionally, in the <strong>Add Sample Response<\/strong> drop-down list, you can select:\n<ul>\n<li><strong>JSON<\/strong> &#8211; A list of JSON key\/value pairs available in the request URL response used in other nodes as variables.<\/li>\n<li><strong>RAW<\/strong> &#8211; A list of key\/value pairs that are used in other nodes as variables.<\/li>\n<\/ul>\n<\/li>\n<li>In the <strong>Component Properties<\/strong> section, under <strong>Advanced Controls<\/strong>, you can configure the <strong>Timeout<\/strong> for terminating the service call. By default, it is set for 20 seconds, you can choose a value anywhere between 5 to 20 seconds.<\/li>\n<\/ol>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3 id=\"URL\"><span class=\"ez-toc-section\" id=\"Define_a_URL_to_Convert_to_Image\"><\/span>Define a URL to Convert to Image<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>When you select <strong>URL to Image<\/strong> in the <strong>Service Type<\/strong>,\u00a0the <strong>Type<\/strong>\u00a0setting is read-only.<\/li>\n<li>In the\u00a0<strong>Request\u00a0Definition<\/strong>\u00a0section, click <span style=\"color: #33cccc;\"><strong>Define Request<\/strong><\/span> to specify the settings when the\u00a0<strong>URL to Image<\/strong>\u00a0is selected for <strong>Service Type<\/strong>. The <strong>Define Request for &lt; <em>Service Node Name<\/em> &gt;<\/strong>\u00a0dialog is displayed as shown in the following illustration.<\/li>\n<li>In the <strong>URL to Convert<\/strong> field, enter the URL for the image. The\u00a0syntax when using a\u00a0<code>Context<\/code> object key in a URL is to enclose the object name in double brackets, for example, <span style=\"color: #0000ff;\">https:\/\/myURLimage.com\/<strong>{{context.entities.imageName}}<\/strong>.<\/span><\/li>\n<li>In the <strong>Render Sizes<\/strong> section, specify a name for the image size. For example, <span style=\"color: #0000ff;\">iPhone<\/span> or <span style=\"color: #0000ff;\">tablet<\/span>, enter the <strong>Width<\/strong> and <strong>Height<\/strong> in pixels; then click <strong><span style=\"color: #33cccc;\">+Add<\/span><\/strong> to add additional sizes, or click <strong>Add<\/strong> to save and close the dialog.<\/li>\n<li>Click <strong>Save<\/strong> to save the request for the service node and close the <strong>Define Request for &lt; <em>Service Node Name<\/em> &gt;<\/strong>\u00a0dialog.<\/li>\n<\/ol>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3 id=\"HTML\"><span class=\"ez-toc-section\" id=\"Define_HTML_to_Convert_to_Image\"><\/span>Define HTML to Convert to Image<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>When you select<strong> HTML to Image<\/strong> in the <strong>Service Type<\/strong>,\u00a0the <strong>Type<\/strong>\u00a0setting is read-only.<\/li>\n<li>In the <strong>Request\u00a0Definition<\/strong>\u00a0section, click <span style=\"color: #33cccc;\"><strong>Define Request<\/strong><\/span>\u00a0to specify the settings when <strong>HTML to Image<\/strong>\u00a0is selected for <strong>Service Type<\/strong>. The <strong>Define Request for &lt; <em>Service Node Name<\/em> &gt;<\/strong>\u00a0dialog is displayed as shown in the following illustration.<\/li>\n<li>In the <strong>HTML to Convert<\/strong> field, enter the HTML\u00a0for the image.<\/li>\n<li>In the <strong>Render Sizes<\/strong> section, specify a name for the image size. For example, <span style=\"color: #0000ff;\">iPhone<\/span> or <span style=\"color: #0000ff;\">tablet<\/span>, enter the <strong>Width<\/strong> and <strong>Height<\/strong> in pixels; then click <strong><span style=\"color: #33cccc;\">+Add<\/span><\/strong> to add additional sizes, or click <strong>Add<\/strong> to save and close the dialog.<\/li>\n<\/ol>\n<p>The following is an example for converting HTML to an image:<\/p>\n<pre class=\"lang:default decode:true\">&lt;head&gt;\r\n&lt;link href=\"..\/assets\/styles.min.css\" rel=\"stylesheet\"\/&gt;\r\n&lt;title&gt;HTML: Print Wide HTML Tables&lt;\/title&gt;\r\n&lt;script src=\"\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.10.2\/jquery.min.js\"&gt;&lt;\/script&gt;\r\n&lt;style&gt;\r\n  .style1 {\r\n     border-collapse: collapse;\r\n     }\r\n  .style1 th {\r\n     background-color: #DDDDDD;\r\n     white-space: nowrap;\r\n     }\r\n  .style1 .d {\r\n     white-space: nowrap;\r\n     }\r\n  .style1 .n {\r\n     padding-left: 20px;\r\n     text-align: right;\r\n     }\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;table id=\"table1\" class=\"style1\" border=\"1\" cellpadding=\"4\" cellspacing=\"0\"&gt;\r\n  \/\/\/TODO Add Table Rows here.\r\n&lt;\/table&gt;\r\n&lt;input type=\"button\" id=\"print-button\" value=\"Make this table printable contact@ {{context.session.UserContext.emailId}}\"\/&gt;\r\n&lt;script&gt;\r\n\/*\r\n * HTML: Print Wide HTML Tables\r\n * http:\/\/salman-w.blogspot.com\/2013\/04\/printing-wide-html-tables.html\r\n*\/\r\n$(function() {\r\n$(\"#print-button\").on(\"click\", function() {\r\n   var table = $(\"#table1\"),\r\n       tableWidth = table.outerWidth(),\r\n       pageWidth = 600,\r\n       pageCount = Math.ceil(tableWidth \/ pageWidth),\r\n       printWrap = $(\"&lt;div&gt;&lt;\/div&gt;\").insertAfter(table),\r\n       i,\r\n       printPage;\r\n   for (i = 0; i &lt; pageCount; i++) {\r\n      printPage = $(\"&lt;div&gt;&lt;\/div&gt;\").css({\r\n          \"overflow\": \"hidden\",\r\n          \"width\": pageWidth,\r\n          \"page-break-before\": i === 0 ? \"auto\" : \"always\"\r\n        }).appendTo(printWrap);\r\n   table.clone().removeAttr(\"id\").appendTo(printPage).css({\r\n      \"position\": \"relative\",\r\n      \"left\": -i * pageWidth\r\n     });\r\n   }\r\n table.hide();\r\n $(this).prop(\"disabled\", true);\r\n});\r\n});\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>The preceding HTML example, when table rows are added into the example, can render the following image to an end-user.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/22\/DIYDialogTaskServiceNodeHTMLtoImageUser.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-9703\" src=\"\/wp-content\/uploads\/sites\/22\/DIYDialogTaskServiceNodeHTMLtoImageUser.png\" alt=\"HTML Image Example\" width=\"280\" height=\"465\" \/><\/a><\/p>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3 id=\"auto\"><span class=\"ez-toc-section\" id=\"Define_Alert_Subscription_Service\"><\/span>Define Alert Subscription Service<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can now automatically subscribe your bot users to send contextually relevant alerts as part of the dialog journey. For example, a person booking a flight ticket for a specific date is auto-subscribed to get regular updates on the weather forecast for the destination city.<br \/>\nTo set up an alert subscription service, follow the below steps:<\/p>\n<ol>\n<li>Open the <strong>Component Properties<\/strong> tab of the service node to which you want to associate the alert.<\/li>\n<li>Under the<strong> General Settings<\/strong> section, select <b>Auto Subscription Service <\/b>from the <b>Service Type <\/b>drop-down list.<\/li>\n<li>Click <b>Define Request<\/b>.<br \/>\n<b>Note<\/b>: To create an alert subscription service, you must base it on an existing alert task. Users are auto-subscribed to the alert task on reaching the associated service node in the dialog.<\/li>\n<li>On the Smart\/Automatic Alerts dialog box, select an alert task from the <b>Choose Alert <\/b>drop-down list. The list consists of only the published alert tasks related to your bot.<\/li>\n<li>Enter the necessary information as explained below.<\/li>\n<\/ol>\n<h4>Alert Subscription (Smart Alert) Configurations<\/h4>\n<p>In a typical alert setup, the alert parameters, filters, and other necessary details are entered by the bot users. Since this is an auto-subscription for alerts, you need to configure those details as a developer.<\/p>\n<h5>Alert Parameters<\/h5>\n<p>These vary according to the alert you select. Provide the default parameter values to use for the Alert Subscription service.<br \/>\nIn this example, the parameters defined for the alert are <em>Topic Name<\/em> and <em>News Region<\/em>. Since the idea is to send weather forecasts to the user for the destination city, you can set the parameter values as <i>Weather Forecast<\/i> and <i>context.entity.destinationcity<\/i> respectively.<\/p>\n<h5>Filters<\/h5>\n<p>These vary according to the alert you select. Provide the filter criteria to use for the Alert Subscription service.<\/p>\n<h5>Alert Frequency<\/h5>\n<p>Provide the frequency to send alert notifications. You need to select a Scheme, Frequency, and Time Frame.<\/p>\n<ul>\n<li>From the <b>Select Scheme<\/b> drop-down list, select daily, weekday, or weekend, depending on when you want to send the alert.<\/li>\n<li>From the <b>Select Frequency <\/b>drop-down list, select <em>Every<\/em> if you want to send multiple alerts at regular intervals of time in a day or select <em>at<\/em> to send one alert at a specific time of the day.<\/li>\n<li>From the <b>Select Time<\/b> drop-down list, select an interval time value or a time of the day, depending on the frequency value chosen above.<\/li>\n<\/ul>\n<p>In this example, we have selected Daily At 6 a.m. which means an alert is sent to the user every day at 6 a.m.<\/p>\n<h5>Smart Alert Expiry<\/h5>\n<p>Configure when to expire sending alerts to the users from one of the following options:<\/p>\n<ul>\n<li>Duration: Stops sending notification after the entered number of days from the date of subscription.<\/li>\n<li>Number of Notifications: Stops sending alerts after an entered number of notifications are sent.<\/li>\n<\/ul>\n<h5>Alert Upgrades<\/h5>\n<p>Define the expected behavior of this alert if an upgraded version of the underlying alert task (the published alert that you have selected at the beginning) is published.<\/p>\n<ul>\n<li><b>Remove Existing Instances<\/b><br \/>\nAll existing subscriptions of this smart alert are removed and users will no longer receive notifications. Users are auto-subscribed to the upgraded alert task only when they execute the dialog and reach the service node in the dialog journey.<\/li>\n<li><b>Allow Users To Manually Upgrade Subscription<br \/>\n<\/b>Users will receive an upgrade notification on the selected channel which is a link that guides them through to upgrade their auto-subscription. If the upgrade is successful, the user will receive a success notification.<\/li>\n<\/ul>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3 id=\"URL\"><span class=\"ez-toc-section\" id=\"Define_a_Data_Service\"><\/span>Define a Data Service<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>When you select <strong>Data Service<\/strong> in the <strong>Service Type<\/strong>,\u00a0the <strong>Type<\/strong> setting provides two options:\n<ul>\n<li>Table &#8211; choose this option to perform CRUD operations on the data table.<\/li>\n<li>View &#8211; choose this option to fetch data from a table view.<\/li>\n<\/ul>\n<p><strong>Note<\/strong>: Your bot should have permission to access the table\/view. The owner of the table\/view has to grant this permission, <a href=\"\/docs\/bots\/advanced-topics\/data-table\/#Assignments\" target=\"_blank\" rel=\"noopener noreferrer\">click here for how<\/a>.<\/li>\n<li>In the <strong>Request\u00a0Definition<\/strong>\u00a0section, click <span style=\"color: #33cccc;\"><strong>Define Request<\/strong><\/span> to specify the operation you want to perform. <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/data-as-service\/\" target=\"_blank\" rel=\"noopener noreferrer\">Click here for details.<\/a><\/li>\n<\/ol>\n<\/div><\/div><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 class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><p><strong>Next Steps<\/strong><\/p>\n<p>For the Service Node you set up, you might want to:<\/p>\n<ul>\n<li>Implement Custom Authentication, <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/implementing-custom-authentication\/\">refer here<\/a>; or<\/li>\n<li>Enable 2-way SSL, <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/enabling-2-way-ssl-for-service-nodes\/\">refer here<\/a>.<\/li>\n<\/ul>\n<\/div><\/div><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>[vc_raw_html]JTNDZGl2JTIwY2xhc3MlM0QlMjJ3LXBvc3QtZWxtJTIwcG9zdF9uYXZpZ2F0aW9uJTIwbGF5b3V0X3NpbXBsZSUyMGludl9mYWxzZSUyMiUzRSUwQSUwOSUzQ2ElMjBjbGFzcyUzRCUyMnBvc3RfbmF2aWdhdGlvbi1pdGVtJTIwb3JkZXJfZmlyc3QlMjB0b19wcmV2JTIyJTIwaHJlZiUzRCUyMiUyRmRvY3MlMkZib3RzJTJGYm90LWJ1aWxkZXItdG9vbCUyRmRpYWxvZy10YXNrJTJGd29ya2luZy13aXRoLXRoZS1jb25maXJtYXRpb24tbm9kZXMlMkYlMjIlM0UlM0MlMkZwJTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJwb3N0X25hdmlnYXRpb24taXRlbS1hcnJvdyUyMiUzRSUzQyUyRmRpdiUzRSUwQSUzQ2RpdiUyMGNsYXNzJTNEJTIycG9zdF9uYXZpZ2F0aW9uLWl0ZW0tbWV0YSUyMiUzRVByZXZpb3VzJTNDJTJGZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJwb3N0X25hdmlnYXRpb24taXRlbS10aXRsZSUyMiUzRSUzQ3NwYW4lM0VDb25maXJtYXRpb24lMjBOb2RlcyUzQyUyRnNwYW4lM0UlM0MlMkZkaXYlM0UlMEElM0NwJTNFJTNDJTJGYSUzRSUzQ2JyJTIwJTJGJTNFJTBBJTNDYSUyMGNsYXNzJTNEJTIycG9zdF9uYXZpZ2F0aW9uLWl0ZW0lMjBvcmRlcl9zZWNvbmQlMjB0b19uZXh0JTIyJTIwaHJlZiUzRCUyMiUyRmRvY3MlMkZib3RzJTJGYm90LWJ1aWxkZXItdG9vbCUyRmRpYWxvZy10YXNrJTJGd29ya2luZy13aXRoLXRoZS1zY3JpcHQtbm9kZSUyRiUyMiUzRSUzQyUyRnAlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnBvc3RfbmF2aWdhdGlvbi1pdGVtLWFycm93JTIyJTNFJTNDJTJGZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJwb3N0X25hdmlnYXRpb24taXRlbS1tZXRhJTIyJTNFTmV4dCUzQyUyRmRpdiUzRSUwQSUzQ2RpdiUyMGNsYXNzJTNEJTIycG9zdF9uYXZpZ2F0aW9uLWl0ZW0tdGl0bGUlMjIlM0UlM0NzcGFuJTNFU2NyaXB0JTIwTm9kZXMlM0MlMkZzcGFuJTNFJTNDJTJGZGl2JTNFJTBBJTNDcCUzRSUzQyUyRmElM0UlM0MlMkZkaXYlM0U=[\/vc_raw_html]<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><\/section>\n","protected":false},"excerpt":{"rendered":"The Service Node is a component type in a dialog task that you can use to add an API service to make REST or SOAP requests to third-party web services. You can use this node when you have the parameters needed for the API request using an entity or other nodes to capture the user...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/17958"}],"collection":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/comments?post=17958"}],"version-history":[{"count":31,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/17958\/revisions"}],"predecessor-version":[{"id":29414,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/17958\/revisions\/29414"}],"wp:attachment":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/media?parent=17958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/categories?post=17958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/tags?post=17958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}