{"id":27052,"date":"2021-03-17T06:26:48","date_gmt":"2021-03-17T06:26:48","guid":{"rendered":"https:\/\/developer.kore.ai\/v9-2\/?p=27052"},"modified":"2021-05-12T12:52:27","modified_gmt":"2021-05-12T11:52:27","slug":"alert-task-rest-api-request","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-2\/docs\/bots\/bot-builder-tool\/alert\/alert-task-rest-api-request\/","title":{"rendered":"Alert Task \u2013 REST API Request"},"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>We have seen how an Alert task can be set up in Kore.ai virtual assistant platform\u00a0<a href=\"\/docs\/bots\/bot-builder-tool\/alert\/notification-tasks\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. In this section, we will see how to configure an API Request for a REST service.<\/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<p>The following illustration is an example of the <strong>API Request<\/strong> tab on the <strong>Edit Alert \u2013 &lt; <em>Task Name<\/em> &gt;<\/strong>\u00a0page for an alert\u00a0task with the\u00a0<strong>Connection Type<\/strong>\u00a0specified as <strong>Webservice<\/strong>\u00a0and the <strong>Connection Mode<\/strong> set to <strong>REST<\/strong>\u00a0defined on the <strong>General<\/strong>\u00a0tab.<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/DIYAlertTaskRequestPage1-1.png\"><br \/>\n<\/a><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/API-Request-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14177\" src=\"\/wp-content\/uploads\/sites\/26\/API-Request-1.png\" alt=\"\" width=\"919\" height=\"558\" \/><\/a><br \/>\nFor a task with the\u00a0<strong>Connection Type<\/strong>\u00a0specified as <strong>Webservice<\/strong>\u00a0and the <strong>Connection Mode<\/strong> set to\u00a0<strong>REST<\/strong>\u00a0you need to define:<\/p>\n<ul>\n<li><strong>Content Type<\/strong> &#8211; The type of data exchanged between Kore.ai and your web application, <a href=\"#Defining_the_Content_Type\">see below for details<\/a>.<\/li>\n<li><strong>Authentication<\/strong> \u2013 If required for your alert task, you will need to define the authentication to access the API, for example, using basic authorization, OAuth, or API Key. <a href=\"\/docs\/bots\/advanced-topics\/authorization\/bot-authentication\/\">Refer here for more details<\/a>.<\/li>\n<li><strong>Parameters<\/strong> \u2013 Define one or more parameters used to process the API request, for example, input from user prompts, selection by an end-user from a list of choices, a URL, and so forth, see below for details, <a href=\"#Defining_Parameters\">see below for details<\/a>.<\/li>\n<li><strong>Initializer<\/strong> \u2013 Specify custom JavaScript to run, or set session variables prior to creating a task instance when web services require code to be executed, or session variables set, or modification of user context details before an API request is executed, <a href=\"#Defining_an_Initializer\">see below for details<\/a>.<\/li>\n<li><strong>Request<\/strong> \u2013 Define a request chain used to make an API call to a web service to initiate the task using URLs and paths to your Bot to initiate the delivery of the data payload from the web service to the Bots Platform. The request chain can consist of pre-processors, API requests, and post-processors, <a href=\"#Defining_the_Request_Chain\">see below for details<\/a>.<\/li>\n<li><strong>Response Sample<\/strong> \u2013 Define key\/value pairs that you expect to receive in the task payload. The keys that you provide are available as drop-down choices for handling the data to display to the end-user, <a href=\"#Adding_the_Response_Sample\">see below for details<\/a>.<\/li>\n<li><strong>Preview Website Link Content in Post<\/strong> &#8211; The website preview content displayed in the task notification message, <a href=\"#Preview_Website_Link_Content\">see below for details<\/a>.<\/li>\n<\/ul>\n<p>Click <strong>Save<\/strong>\u00a0to save the API request settings.<\/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<h3><span class=\"ez-toc-section\" id=\"Defining_the_Content_Type\">Defining the Content Type<\/span><\/h3>\n<p>The\u00a0<strong>Content Type<\/strong>\u00a0describes the type of data exchanged between Kore.ai and your Bot website or application, and the key-value pairs expected in the task\u00a0payload response. To define the Content Type for the API Request (REST), expand the <strong>Content Type<\/strong> tab and select one of these options:<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/Content-Type.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14179\" src=\"\/wp-content\/uploads\/sites\/26\/Content-Type.png\" alt=\"\" width=\"1079\" height=\"441\" \/><\/a><\/p>\n<ul>\n<li><strong>JSON<\/strong> &#8211;\u00a0JavaScript Object Notation is an open standard format using\u00a0human-readable text to transmit data objects as\u00a0attribute-value pairs. You can use JSON\u00a0to transmit data between the Kore.ai servers and your Bot\u00a0web application.<\/li>\n<li><strong>RSS<\/strong> &#8211; Rich Site Summary, or Really Simple Syndication, is a family of standardized formats used to publish frequently updated information such as blog entries, news headlines, audio, and video.<\/li>\n<li><strong>XML<\/strong> &#8211; Extensible Markup Language is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. Oftentimes, web services use XML schemas to process the XML data.<\/li>\n<li><strong>URL Encoded JSON<\/strong> &#8211; URLs using JSON encoding for reserved characters.<\/li>\n<li><strong>CSV<\/strong> &#8211; Comma-separated value lists.<\/li>\n<li><strong>Text<\/strong> &#8211; Text-based key-value pairs.<\/li>\n<li><strong>Twitter Encoded JSON<\/strong> &#8211; URLs for Twitter using JSON encoding for reserved characters.<\/li>\n<li><strong>Multipart\/Form-data<\/strong> &#8211; 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<b>.<\/b><\/li>\n<li><strong>Multipart\/Related<\/strong> &#8211; Used when the same information is presented in different body parts in different forms. The body parts are ordered by increasing complexity.<\/li>\n<li><strong>Oracle ADF<\/strong> &#8211; For Oracle Application Development Framework.<\/li>\n<\/ul>\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=\"Defining_Parameters\">Defining Parameters<\/span><\/h3>\n<p>Follow these steps to define the API Request (REST) parameters:<\/p>\n<ol>\n<li>Click the <strong>Parameters<\/strong> section, and then click <strong>Add.\u00a0\u00a0<\/strong>The <em>Set Up Task Parameter<\/em> dialog opens.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/PAyload-parameters-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-16889\" src=\"\/wp-content\/uploads\/sites\/26\/PAyload-parameters-1.png\" alt=\"\" width=\"650\" height=\"713\" \/><\/a><\/li>\n<li>Depending on your selection, enter the values for the relevant fields as described in the following table.<br \/>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Field Name<\/th>\n<th style=\"text-align: center;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Type of Task Parameter<\/td>\n<td>\n<p>Specify one of the following:<\/p>\n<ul>\n<li><strong>Payload Parameter<\/strong>\u00a0&#8211; Use this field type to represent payload data for an HTTP method, such as POST, PUT, GET, DELETE, and so forth. For example:\n<pre class=\"lang:default decode:true \">{\r\n   \"taskId\":\"{payloadfield2}\",\r\n   \"message\":\"{payloadfield1}\"\r\n}<\/pre>\n<\/li>\n<li><strong>Query Parameter<\/strong>\u00a0&#8211; This field type is used as part of a URL path or query within a\u00a0URL. For example:<br \/>\n<code>http:\/\/app.asana.com\/api\/workspaces\/<span class=\"s1\"><strong>{queryfield1}<\/strong>\/project\/<strong>{queryfield2}<\/strong>?userId=<strong>{queryfield3}<\/strong><\/span><\/code><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>Parameter Name<\/td>\n<td>The title of the task input\u00a0field displayed to the user, for example, <i>Choose account<\/i><\/td>\n<\/tr>\n<tr>\n<td>Prompt Message<\/td>\n<td>The help description displayed below the parameter name, for example, <i>Which account would you like to access?<\/i><\/td>\n<\/tr>\n<tr>\n<td>Parameter Key<\/td>\n<td>The task\u00a0key that represents the end-user input value that you want to collect, for example, <i>accountType<\/i>.<\/td>\n<\/tr>\n<tr>\n<td>Parameter Type<\/td>\n<td>\n<p>Specifies the type of task input\u00a0field displayed in the end-user interface to collect user input for the request object to assign to the <strong>Key<\/strong> value. The default setting is <strong>Textbox<\/strong>, but can be customized to any one of the following:<\/p>\n<ul>\n<li><strong>Date<\/strong> &#8211; Displays the <strong>Format<\/strong> field where you can select the\u00a0date format syntax\u00a0for the end-user to define when the task\u00a0is configured for their account. In the <strong>Select Date Format<\/strong> drop-down list, select one of the following:\n<ul>\n<li><strong>dd-MM-YYYY<\/strong>\u00a0&#8211; For example,\u00a0<span style=\"color: #0000ff;\">16-05-1999<\/span><\/li>\n<li><strong>MM-dd-YYYY<\/strong>\u00a0&#8211; For example,\u00a0<span style=\"color: #0000ff;\">05-16-1999<\/span><\/li>\n<li><strong>dd-MM-YY<\/strong>\u00a0&#8211; For example,\u00a0<span style=\"color: #0000ff;\">16-05-99<\/span><\/li>\n<li><strong>YYYY-MM-dd<\/strong> &#8211; For example,\u00a0<span style=\"color: #0000ff;\">1999-05-16<\/span><\/li>\n<\/ul>\n<\/li>\n<li><strong>URL<\/strong> &#8211; Displays a text box for the end-user to enter a URL including field validation for correct URL syntax. In the <strong>Placeholder<\/strong> field, enter the help hint displayed in the text box, for example, <span style=\"color: #0000ff;\">Enter the URL for the website here.<\/span><\/li>\n<li><strong>Textbox<\/strong> &#8211; Displays a text box for the end-user to enter the text as the task input field, typically just a few words. In the <strong>Placeholder<\/strong> field, enter the help hint displayed in the text field, for example, <span style=\"color: #0000ff;\">Type\u00a0in the name you want to embroider.<\/span><\/li>\n<li><strong>Static Dropdown<\/strong> &#8211; Displays a drop-down list of choices to the end-user. Click <strong>Add Option<\/strong> to begin adding the list of items to display to the end-user with the following parameters:\n<ul>\n<li><strong>Option Name <\/strong>&#8211; The name of the option displayed to the end-user.<\/li>\n<li><strong>Option Value<\/strong> &#8211; The value the represents the <strong>Option Name<\/strong>\u00a0returned to the application.<\/li>\n<li><strong>Default Value<\/strong> &#8211; Select the default value for the option when more than one option is defined.<\/li>\n<li><strong>Searchable<\/strong> &#8211; Select to enable dynamic search and display as the end-user enters text in this field, or if no matches, allow free-form entry.<\/li>\n<\/ul>\n<p>Click <strong>Save<\/strong>. To add additional items, click <strong>Add Option<\/strong> again. Edit or remove options in the <b>Actions<\/b> column for options.<\/li>\n<li><strong>Dynamic Dropdown<\/strong> &#8211; Displays a drop-down list dynamically populated at runtime based on the response from a URL for your Bot, for example, a list of projects for a <em>JIRA<\/em>\u00a0task notification. Define the following properties for a dynamically populated dropdown.\n<ul>\n<li><strong>Endpoint URL<\/strong> &#8211; The Bot\u00a0endpoint URL, for example,\u00a0<span style=\"color: #0000ff;\">https:\/\/app.asana.com\/api\/1.0\/workspaces<\/span>.<\/li>\n<li><strong>Endpoint Content Type<\/strong> &#8211; The content type expected from the specified endpoint URL. One of: JSON, RSS, XML, URL Encoded JSON, CCV, Text, or Twitter Encoded JSON.<\/li>\n<li><strong>Endpoint Method<\/strong> &#8211; One of:\n<ul>\n<li><strong>GET<\/strong> &#8211; Specifies an HTTP Request GET method for the task\u00a0field.<\/li>\n<li><strong>POST<\/strong> &#8211; Specifies an HTTP Request POST method for the task\u00a0field.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Response Path<\/strong> &#8211; The path in the response that contains the desired drop-down list values, for example, <span style=\"color: #0000ff;\">data<\/span>.<\/li>\n<li><strong>Label Key<\/strong> &#8211; The key for the label of the drop-down option, for example, <span style=\"color: #0000ff;\">name<\/span>.<\/li>\n<li><strong>Option Value Key<\/strong> &#8211; The key for the value of the drop-down option, for example, <span style=\"color: #0000ff;\">id<\/span>.<\/li>\n<li><strong>Add Payload Field<\/strong> &#8211; Click to add one or more fields from the response payload as options for the dynamic dropdown. For each payload field, enter the <strong>Payload field key<\/strong> and the <strong>Payload field value<\/strong>, and then click <strong>Save<\/strong>. Edit or delete payload fields in the <strong>Actions<\/strong> column.<\/li>\n<li><strong>Searchable<\/strong> &#8211; Select to enable dynamic search and display as the end-user enters text in this field, or if no matches, allow free-form entry.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li><strong>Textarea<\/strong> &#8211; Displays a text area box for the end-user to enter the text as the task input, typically for several sentences. In the <strong>Placeholder<\/strong> field, enter the help hint displayed inside the text area.<\/li>\n<li><strong>Type Ahead<\/strong>\u00a0&#8211; Displays a dynamically populated drop-down list of choices to the end-user at runtime when the user enters three or more characters that match the search results based on the response from the\u00a0URL defined for the task. For example, a list of projects for a <em>JIRA<\/em>\u00a0task notification message. Define the following properties for a dynamically populated drop-down.\n<ul>\n<li><strong>Endpoint URL<\/strong> &#8211; The Bot\u00a0endpoint URL, for example,\u00a0<span style=\"color: #0000ff;\">https:\/\/app.asana.com\/api\/1.0\/workspaces<\/span>.<\/li>\n<li><strong>Endpoint Content Type<\/strong> &#8211; The content type expected from the specified endpoint URL. One of: JSON, RSS, XML, URL Encoded JSON, CCV, Text, Twitter Encoded JSON, Multipart\/Form-data, or Multipart\/Related.<\/li>\n<li><strong>Endpoint Method<\/strong> &#8211; One of:\n<ul>\n<li><strong>GET<\/strong> &#8211; Specifies an HTTP Request GET method for the task\u00a0field.<\/li>\n<li><strong>POST<\/strong> &#8211; Specifies an HTTP Request POST method for the task\u00a0field.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Response Path<\/strong> &#8211; The path in the response that contains the desired drop-down list values, for example, <span style=\"color: #0000ff;\">data<\/span>.<\/li>\n<li><strong>Label Key<\/strong> &#8211; The key for the label of the drop-down option, for example, <span style=\"color: #0000ff;\">name<\/span>.<\/li>\n<li><strong>Option Value Key<\/strong> &#8211; The key for the value of the drop-down option, for example, <span style=\"color: #0000ff;\">id<\/span>.<\/li>\n<li><strong>Add Payload Field<\/strong> &#8211; Click to add one or more fields from the response payload as options for the type ahead field. For each type ahead field option, enter the <strong>Payload field key<\/strong> and the <strong>Payload field value<\/strong>, and then click <strong>Save<\/strong>. Edit or delete payload fields in the <strong>Actions<\/strong> column.<\/li>\n<li><strong>Editable<\/strong> &#8211; Enables the end-user to enter text free-from in the field as an option when type-ahead search results do not match.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Email<\/strong> &#8211; Displays a text box for the end-user to input\u00a0an email address. In the <strong>Placeholder<\/strong> field, enter the helpful hint to display to the end-user inside the text box.<\/li>\n<li><strong>Date &amp; Time<\/strong> &#8211; Displays a text box for the end-user to input\u00a0a date with\u00a0time. In the <strong>Format<\/strong> field, enter the expected date or time format to display to the end-user in the date text box. In the <strong>Select Date Format<\/strong> drop-down list, select the date with\u00a0time format.<\/li>\n<li><strong>Time Zone<\/strong> &#8211; Displays a drop-down list of time zones based on the operating system settings.<\/li>\n<li><strong>Location<\/strong> &#8211; Displays a text box for the end-user to enter a geographical location, for example, <span style=\"color: #0000ff;\">Orlando, FL<\/span>, or <span style=\"color: #0000ff;\">32801<\/span>.<\/li>\n<li><strong>Nested Form<\/strong> &#8211; Displays end-user input fields in a nested format below the parent input field. Specify the following fields for a nested form input field:\n<ul>\n<li><strong>Array Element\u00a0Type<\/strong> &#8211; Select\u00a0the data type of the parent input form element.<\/li>\n<li><strong>Add Nested Form Field<\/strong> &#8211; Click to add one or more nested form fields.<\/li>\n<\/ul>\n<\/li>\n<li><strong>File Upload<\/strong> &#8211; Displays end-user control to search for, and select a file to upload. When clicked, enter the <strong>File Upload Payload Key<\/strong>. When the <strong>File Upload Payload Key<\/strong> is defined, in the <strong>File Upload Payload Field Value<\/strong> drop-down list, select one of the following types:\n<ul>\n<li><strong>File Name<\/strong><\/li>\n<li><strong>File Size<\/strong><\/li>\n<li><strong>File Content Type<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>Data Type<\/td>\n<td>\n<p>Select one of these user input types:<\/p>\n<ul>\n<li><strong>String<\/strong> &#8211; Users can input any sequence of numbers, letters, or special characters.<\/li>\n<li><strong>Number<\/strong> &#8211; Users can input a number. No special characters are allowed.<\/li>\n<li><strong>Boolean<\/strong> &#8211; User can input a Boolean value of <span style=\"color: #0000ff;\">true<\/span> or <span style=\"color: #0000ff;\">false<\/span>.<\/li>\n<li><strong>Email<\/strong> &#8211; User can input a valid email address.<\/li>\n<li><strong>Object<\/strong> &#8211; Data from a Bot\u00a0can be received as JSON objects, for example, as location details defined as:<br \/>\n<span style=\"color: #0000ff;\">\u00a0&#8220;location&#8221; : {<br \/>\n<\/span><span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8220;lat&#8221; : 17.4374614,<br \/>\n<\/span><span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8220;lng&#8221; : 78.4482878<\/span><br \/>\n<span style=\"color: #0000ff;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/span><br \/>\nwhere you can refer to the properties in a request chain or task\u00a0request as <span style=\"color: #0000ff;\">location.lat<\/span>, and <span style=\"color: #0000ff;\">location.lng<\/span>.<\/li>\n<li><strong>Array<\/strong> &#8211; Users can pass a comma-separated list of values to the Bot. For example, in <em>Google Calendar<\/em>, multiple attendees with data can be passed as:<br \/>\n<span style=\"color: #0000ff;\">&#8220;attendees&#8221;: [&#8220;user1&#8221;, &#8220;user2&#8221;, &#8220;user3&#8221;]<br \/>\n<\/span>When selected, specify the <strong>Type<\/strong> for the array of end-user input as one of:<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ol>\n<ul>\n<li><strong>String<\/strong><\/li>\n<li><strong>Number<\/strong><\/li>\n<li><strong>Boolean<\/strong><\/li>\n<li><strong>Email<\/strong><\/li>\n<li><strong>Array<\/strong><\/li>\n<li><strong>Date<\/strong><\/li>\n<li><strong>Date<\/strong> &#8211; Users can type a complete date or select <span style=\"background-color: #f6d5d9;\">it\u00a0<\/span>from a date picker.<\/li>\n<\/ul>\n<p>Is Multi SelectAllows the user to make more than one selection or entry. This field is displayed depending on the <strong>Field Type<\/strong> selected.<\/p>\n<ul>\n<li>Click the\u00a0<strong>Advanced Settings<\/strong>\u00a0tab to define additional optional settings for the task fields.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/Advanced-parameters.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14074\" src=\"\/wp-content\/uploads\/sites\/26\/Advanced-parameters.png\" alt=\"\" width=\"519\" height=\"536\" \/><\/a><\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Field Name<\/th>\n<th style=\"text-align: center;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Visibility<\/td>\n<td>Specify if the task input\u00a0field should be visible or hidden from the end-user.<br \/>\nThe <strong>Visibility<\/strong> field can also be set to <strong>Custom<\/strong> where data is captured from the user but not used as a query parameter or payload field. For example, with a JIRA bot, posting a comment on a ticket using an @mention tag as shown below:<br \/>\n&#8220;@Mike, please look into this issue&#8221;<br \/>\nThe JIRA API to &#8216;Post a comment&#8217; requires one query field and one payload field as:<\/p>\n<ul>\n<li>Issue ID<\/li>\n<li>Comment<\/li>\n<\/ul>\n<p>With the <strong>Visibility<\/strong> field set to <strong>Custom<\/strong>, you can capture the user information for the user mentioned as <code>@Mike<\/code> using the JIRA API to fetch data to append to the <code>comment<\/code> field value, but not to use as payload field or query field. The default <strong>Visibility<\/strong> field setting is <strong>Visible<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td>Mandatory<\/td>\n<td>Select if the\u00a0end-user must define this setting to save the task\u00a0settings configuration.<\/td>\n<\/tr>\n<tr>\n<td>Untranspose the Key<\/td>\n<td>Select to disable key transposition by Kore.ai. By default, Kore.ai transposes a key\/value pair, for example, &#8220;parameter&#8221;:&#8221;value&#8221; is transposed by Kore.ai to &#8220;parameter:{value:&#8221;actualValue&#8221;}. When selected, keys are not transposed.<\/td>\n<\/tr>\n<tr>\n<td>Fetch from Session<\/td>\n<td>\n<p>Select to store the user input value for this field as a session variable. When selected, the <strong>Field Value from Session<\/strong> field is displayed. Select an existing variable, or select <strong>Add New Session Variable<\/strong> to define a new variable. To create a new session variable, you must select the <strong>Scope<\/strong> of the variable and define the <strong>Key<\/strong> to store the variable. In the <b>Scope<\/b> field, select one of:<\/p>\n<ul>\n<li><strong>EnterpriseContext<\/strong> &#8211; Define a key\/value pair available to all users in an enterprise.<\/li>\n<li><strong>BotContext<\/strong> &#8211; Define a key\/value pair available to all users of this bot.<\/li>\n<li><strong>UserSession<\/strong> &#8211; Define a key\/value pair available for this user for any bots in an enterprise.<\/li>\n<li><strong>BotUserSession<\/strong> &#8211; Define a key\/value pair available a bot based on user inputs.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>Click <strong>Add &amp; Continue<\/strong>\u00a0to save the parameter\u00a0for the task\u00a0request and add another parameter, or click\u00a0<strong>Add &amp; Exit<\/strong>\u00a0to save the parameter\u00a0for the task\u00a0request and close the dialog. You should organize multiple parameters\u00a0in the order that the bot user should provide inputs. Use the\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"inline\" src=\"\/wp-content\/uploads\/sites\/26\/MoveDownIcon.png\" alt=\"\" width=\"22\" height=\"24\" \/>\u00a0and\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"inline\" src=\"\/wp-content\/uploads\/sites\/26\/MoveUpIcon.png\" alt=\"\" width=\"22\" height=\"24\" \/>\u00a0icons to move the parameters.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskAPIRequestTabParametersSectionSort.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9786\" src=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskAPIRequestTabParametersSectionSort.png\" alt=\"Action Task - API Request Tab - Parameters Section - Sort\" width=\"872\" height=\"368\" \/><\/a><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\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=\"Defining_an_Initializer\">Defining an Initializer<\/span><\/h3>\n<p>To run a task, you may need to put or get values from a session before executing the task using Kore.ai session-specific variables.\u00a0 For more information, see <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/using-session-and-context-variables-in-tasks\/\">Using Session and Context Variables in Tasks<\/a>. Some web services require executed code, session variables, or modification of user context details before executing an API request. For example, a web service may require two-factor user authorization where the first step is a user log in, and the second step is a partner authorization. After validating both these steps, an access token is granted and used in the header of subsequent API calls to that web service. Using the <strong>Initializer<\/strong>, you can complete partner authorization and retrieve the access token from the response of the user authentication. The access token can be stored as a custom session variable and set as the header for subsequent API calls.<\/p>\n<h4>Define Task Initializer<\/h4>\n<p>To configure the task initializer, click the <strong>Initializer<\/strong> tab. It opens a JavaScript editor in which you can write the required code.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskAPIRequestTabInitializerSection.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9792\" src=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskAPIRequestTabInitializerSection.png\" alt=\"Action Task - API Request Tab - Initializer Section\" width=\"1018\" height=\"448\" \/><\/a><br \/>\nIn the JavaScript editor, define the <strong>Key<\/strong>\u00a0and the <strong>Scope<\/strong> as follows:<\/p>\n<ul>\n<li><strong>EnterpriseContext<\/strong> &#8211; A\u00a0key-value pair available to all bots and all users in an enterprise. For example, for a GitHub bot, a user needs to access one or more enterprise repositories. In the <strong>Initializer<\/strong>, you can persist the repository data as <strong>Gitrepository (Enterprise Context)<\/strong> with the following JavaScript code:\n<pre class=\"lang:default decode:true\">var userRepository = {\r\n\"title\": _labels_[repository],\r\n\"value\": repository\r\n};\r\nEnterpriseContext.put('Gitrepository', userRepository, 200000);<\/pre>\n<\/li>\n<li><strong>BotContext<\/strong> &#8211; A\u00a0key-value pair available to all users of this specific bot. For example, you may want to set up a default currency for financial transactions in a session based on the user location.\u00a0In the <strong>Initializer<\/strong>, you can persist the default currency\u00a0data as <strong>currency (Bot Context)<\/strong> with the following JavaScript code:\n<pre class=\"lang:default decode:true\">var defaultCurrency = { TODO Custom JavaScript for location-based currency }\r\nBotContext.put('currency', defaultCurrency, 200000);<\/pre>\n<\/li>\n<li><strong>UserContext<\/strong> &#8211; A key-value pair available to all bots for a user. These keys are read-only and provided by the system as user data for:\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>_id<\/strong> &#8211; The Kore.ai userId.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>emailId<\/strong> &#8211; The email address associated with the userId.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>lastName<\/strong> &#8211; The last name of the user.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>firstName<\/strong> &#8211; The first name of the user.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>profImage<\/strong> &#8211; The image or avatar filename of the user.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>profColour<\/strong> &#8211; The account color for the user.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>activationStatus<\/strong> &#8211; The account status of the user.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>title<\/strong> &#8211; The title of the user, if defined.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>orgId<\/strong> &#8211; The organizational ID of the user account, if defined.<\/span><\/li>\n<\/ul>\n<\/li>\n<li><strong>UserSession<\/strong> &#8211; Define a key-value pair available for this specific user for all bots in an enterprise. For example, you may want to store a user location to make it\u00a0available to all bots, such as a user home address for commerce, transportation, and home\u00a0delivery services.\u00a0In the <strong>Initializer<\/strong>, you can persist the default location\u00a0data as <strong>HomeLocation (UserSession)<\/strong> with the following JavaScript code:\n<pre class=\"lang:default decode:true\">var location = {\r\n \"title\": labels[location],\r\n \"value\": {\r\n \"latitude\": location.latitude,\r\n \"longitude\": request.location.longitude\r\n }\r\n};\r\nUserSession.put('HomeLocation', location, '20000');<\/pre>\n<\/li>\n<li><strong>BotUserSession<\/strong> &#8211; Define a key-value pair available to a specific bot based on a specific user&#8217;s inputs. For example, you may want to persist in a user location for more than one bot task. For a travel bot, the user may be able to book a flight and a hotel based on the same home and destination addresses.\u00a0In the\u00a0<strong>Initializer<\/strong>, you can persist the default home and destination\u00a0data as <strong>HomeLocation (BotUserSession)<\/strong>\u00a0and <strong>DestinationLocation (BotUserSession)<\/strong> with the following JavaScript code:\n<pre class=\"lang:default decode:true\">var homelocation = {\r\n \"title\": labels[request.sourceLocation],\r\n \"value\": {\r\n \"latitude\": request.sourceLocation.latitude,\r\n \"longitude\": request.sourceLocation.longitude\r\n }\r\n};\r\nBotUserSession.put('HomeLocation', homelocation, '20000');\r\nvar destlocation = {\r\n \"title\": labels[request.destLocation],\r\n \"value\": {\r\n \"latitude\": request.destLocation.latitude,\r\n \"longitude\": request.destLocation.longitude\r\n }\r\n};\r\nBotUserSession.put('DestinationLocation', destlocation, '20000\u2019);<\/pre>\n<\/li>\n<\/ul>\n<h4>GET and PUT Syntax<\/h4>\n<p>The following code examples show the syntax to GET or PUT a key-value pair for each context type.<\/p>\n<pre class=\"lang:default decode:true\">\"EnterpriseContext\" : {\r\n       \"get\" : function(key){...},\/\/get the specified key\r\n       \"put\" : function(key, value, ttl){...} \/\/put the value at the key for the specified ttl, ttl is in minutes\r\n   },\r\n   \"BotContext\" : {\r\n       \"get\" : function(key){...},\/\/get the specified key\r\n       \"put\" : function(key, value, ttl){...} \/\/put the value at the key for the specified ttl, ttl is in minutes\r\n   },\r\n   \"UserContext\" : {\r\n       \"get\" : function(key){...},\/\/get the specified key\r\n   },\r\n   \"UserSession\" : {\r\n       \"get\" : function(key){...},\/\/get the specified key\r\n       \"put\" : function(key, value, ttl){...} \/\/put the value at the key for the specified ttl, ttl is in minutes\r\n   },\r\n   \"BotUserSession\" : {\r\n       \"get\" : function(key){...},\/\/get the specified key\r\n       \"put\" : function(key, value, ttl){...} \/\/put the value at the key for the specified ttl, ttl is in minutes\r\n   }<\/pre>\n<p>For example:<\/p>\n<pre class=\"lang:default decode:true\">\u00a0 \u00a0 BotContext.put(\"topicSessionVariable\",\"music\",2000);\r\n\u00a0 \u00a0 UserSession.put(\"firstName\",\"Mary\",20000);\r\n\u00a0 \u00a0 UserContext.get(\"firstName\");<\/pre>\n<h4>Exception Syntax<\/h4>\n<p>You can also define custom error messages to catch errors before setting up a task, for example, authentication failure. If an exception is captured, the task setup is halted. Use the following syntax to throw the exception:<\/p>\n<pre class=\"lang:default decode:true\">{\r\n    \"exceptions\": {\r\n        \"message\": \" Error Message\"\r\n    }\r\n}<\/pre>\n<p>For example,<\/p>\n<pre class=\"lang:default decode:true\">var ex ={};\r\nvar exceptions={};\r\nexceptions.message ='You can not proceed further with out valid permissions';\r\nex.exceptions = exceptions;\r\nprint(JSON.stringify(ex)); \/\/print is mandatory.<\/pre>\n<p>In the <strong>Initializer<\/strong> section, you can use session <strong>Keys<\/strong>, or other session variables, however, you cannot set or access values. For example,<\/p>\n<pre class=\"lang:default decode:true\">var name = UserContext.get(\"firstName\")+UserContext.get(\"lastName\");\r\nUserSession.put(\"fullName\") = name;<\/pre>\n<p>In the preceding code example, you PUT a value into the session using a task\u00a0<strong>Parameter<\/strong>\u00a0defined with the <strong>Fetch from Session<\/strong> field in the <strong>Advanced Settings<\/strong> section for the task. The <strong>Key<\/strong> is defined as <code>fullName<\/code> for the custom defined <code>UserSession<\/code> context variable.<\/p>\n<h4>Task Initializer Example<\/h4>\n<p>The following code is an example of a <strong>Task Initializer<\/strong> to get the user ID and email data to pre-populate variables in the API request.<\/p>\n<pre class=\"lang:default decode:true\">var x = UserContext.get(\"identities\");\r\nvar isEmailFound = false;\r\nfor (var i = 0; i &lt; x.length; i++) {\r\n    if (x[i].type === \"mapped\") {\r\n        var identity = x[i].val\r\n        var arr = identity.split(\"\/\");\r\n        var pattern = \/^cs\/i;\r\n        var result = arr[0].match(pattern);\r\n        if (result) {\r\n            isEmailFound = true;\r\n            UserSession.put(\"rtmEmail\", arr[1], '20000');\r\n        }\r\n    }\r\n}\r\nif (!isEmailFound) {\r\n    for (var j = 0; j &lt; x.length; j++) {\r\n        if (x[j].type === \"email\") {\r\n            UserSession.put(\"rtmEmail\", x[j].val, '20000');\r\n        }\r\n    }\r\n}<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\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=\"Defining_the_Request_Chain\">Defining the Request Chain<\/span><\/h3>\n<p>In the Request\u00a0section of the API Request tab, you can define an API request chain consisting of pre-processors, API Requests, and post-processors. At least one API Request is required, while processors are optional.<\/p>\n<h6>API Request<\/h6>\n<p>For any task, you will need to define an API request to make a call to a web service to initiate the task. At least one API request is required for each task. For each API request, you must add one or more request URLs and paths to your task to initiate the delivery of the data payload from the web service.<\/p>\n<h6>Configuring the API Request<\/h6>\n<ol>\n<li>On the <strong>API Request<\/strong> tab, expand the <strong>Request<\/strong> tab, and then click, <strong>Add API<\/strong>.<\/li>\n<li>Specify the values for the fields in the <strong>Add API<\/strong>\u00a0dialog\u00a0as described in the following\u00a0procedure.<br \/><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/Add-API.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14120\" src=\"\/wp-content\/uploads\/sites\/26\/Add-API.png\" alt=\"\" width=\"668\" height=\"599\" \/><\/a><\/li>\n<li>In the <strong>Name<\/strong> field, enter the name of your API request, for example, <em><span style=\"color: #0000ff;\">My API Request<\/span><\/em>.<\/li>\n<li>In the<strong> Method<\/strong>\u00a0drop-down list, select the HTTP method used\u00a0for the task. One of:\n<ul>\n<li><strong>POST\u00a0<\/strong>&#8211; Used to send data to the server such as customer information, file upload, using HTML forms.<\/li>\n<li><strong>PUT\u00a0<\/strong>&#8211;\u00a0Replaces the content\u00a0of the target resource with the content sent.<\/li>\n<li><strong>PATCH<\/strong> &#8211; Appends\u00a0the content\u00a0of an existing target resource with the content sent.<\/li>\n<li><strong>DELETE<\/strong> &#8211; Deletes the content of an existing target resource.<\/li>\n<li><strong>GET<\/strong> &#8211; Returns the content of an existing target resource.<\/li>\n<\/ul>\n<\/li>\n<li>In the <strong>URL<\/strong> field, specify the URL for the bot task response to the process. For example, <span style=\"color: #0000ff;\">http:\/\/koremessenger.com\/postURL<\/span>. You can also use session variables in the URL as shown in the following example:\n<pre class=\"lang:default decode:true \">https:\/\/mySite.crm.ondemand.com\/sap\/c4c\/odata\/v1\/c4codata\/ServiceRequestCollection?$filter=ID eq '{id}' and ReporterEmail eq '{userEmail}'&amp;amp;$expand=ServiceRequestHistoricalVersion,ServiceRequestDescription<\/pre>\n<\/li>\n<li>In the<strong> Access Using A Connector<\/strong>\u00a0field, select <strong>Yes<\/strong> to enable access for Kore.ai Bots using the Kore.ai Connector agent. This option is only visible if a Kore.ai Connector agent is configured and enabled in your enterprise on-premises network. For more information, see <a href=\"\/docs\/bots\/admin-console\/security-control\/security-module-overview\/#Why_Use_the_Koreai_Connector_for_Bots\">Using the Kore.ai Connector<\/a>.<\/li>\n<li>On the <strong>Headers<\/strong> tab, in the <strong>Content Type<\/strong> field, select one of the following supported data types for your sample response data.\n<ul>\n<li><strong>JSON<\/strong> &#8211;\u00a0JavaScript Object Notation is an open standard format using\u00a0human-readable text to transmit data objects as attribute-value pairs. You can use JSON\u00a0to transmit data between the Kore.ai servers and your Bot\u00a0web application.<\/li>\n<li><strong>RSS<\/strong> &#8211; Rich Site Summary, or Really Simple Syndication, is a family of standardized formats used to publish frequently updated information such as blog entries, news headlines, audio, and video.<\/li>\n<li><strong>XML<\/strong> &#8211; Extensible Markup Language is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. Oftentimes, web services use XML schemas to process the XML data.<\/li>\n<li><strong>URL Encoded JSON<\/strong> &#8211; URLs using JSON encoding for reserved characters.<\/li>\n<li><strong>CSV<\/strong> &#8211; Comma-separated value lists.<\/li>\n<li><strong>Text<\/strong> &#8211; Text-based key-value pairs.<\/li>\n<li><strong>Twitter Encoded JSON<\/strong> &#8211; URLs for Twitter using JSON encoding for reserved characters.<\/li>\n<li><strong>Multipart\/Form-data<\/strong> &#8211; 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<b>.<\/b><\/li>\n<li><strong>Multipart\/Related<\/strong> &#8211; Used when the same information is presented in different body parts in different forms. The body parts are ordered by increasing complexity.<\/li>\n<li><strong>Oracle ADF<\/strong> &#8211; For Oracle Application Development Framework.<\/li>\n<\/ul>\n<\/li>\n<li>In the <strong>Authorization Headers<\/strong> section, select or clear keys to enable or disable the key for the header as shown in the following illustration.<br \/><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskAPIRequestTabRequestSectionAddAPIDialogAuthHeaders.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9796\" src=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskAPIRequestTabRequestSectionAddAPIDialogAuthHeaders.png\" alt=\"Action Task - API Request Tab - Request Section - Add API Dialog - Auth Headers\" width=\"534\" height=\"263\" \/><\/a><\/li>\n<li>On the <strong>Parameters<\/strong> tab, select or clear\u00a0any <strong>Auth Parameters<\/strong> or <strong>Parameters<\/strong> to include in the header as shown in the following illustration.<br \/><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskAPIRequestTabRequestSectionAddAPIDialogParams.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9797\" src=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskAPIRequestTabRequestSectionAddAPIDialogParams.png\" alt=\"Action Task - API Request Tab - Request Section - Add API Dialog - Params\" width=\"567\" height=\"317\" \/><\/a><\/li>\n<li>Click <strong>Save<\/strong> to save and close the API Request configuration.<\/li>\n<\/ol>\n<h6>Processors<\/h6>\n<p>Processors allow you to manipulate data collected in the user session before, during, or after an API request to a web service using JavaScript.<br \/>If you define and place a processor before the API Request, it is a pre-processor. Pre-processors allow you to\u00a0manage input parameters and values from session variables before the API Request is made.<br \/>If the processor is sequentially placed after the API Request, it is a post-processor. You can use a post-processor to access payload response keys from the API request. To access keys, use one of the following post-processor types:<\/p>\n<ul>\n<li><strong>Resolve:\u00a0<\/strong>To use the results of one payload response as input for a second request.<\/li>\n<li><strong>Spread<\/strong> &#8211; To separate arrays of data in a payload.<\/li>\n<li><strong>Extract<\/strong> &#8211;\u00a0To specify a path to a specific object in a payload with multiple objects.<\/li>\n<li><strong>Assign<\/strong> &#8211; To specify a variable name for the payload response.<\/li>\n<\/ul>\n<h6>Pre-processors<\/h6>\n<p>You can use a\u00a0pre-processor to manage request parameters before the API Request is executed, using session variables and parameters. When defining a pre-processor, you must set <strong>Type of Process<\/strong> to <strong>custom<\/strong> and then enter your\u00a0code in the JavaScript editor displayed. A pre-processor can only be of <strong>Type custom<\/strong>.<\/p>\n<h6>Adding a Pre-Processor<\/h6>\n<ol>\n<li>On the <strong>API Request<\/strong> page, expand the <strong>Request<\/strong>\u00a0tab, and then click <strong>Add Processor<\/strong>.<br \/><a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/Add-Request.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14105\" src=\"\/wp-content\/uploads\/sites\/26\/Add-Request.png\" alt=\"\" width=\"1067\" height=\"296\" \/><\/a><\/li>\n<li>Enter the name of your processor in the <strong>Name<\/strong> field.<\/li>\n<li>In the <strong>Type of Process<\/strong> drop-down list, you must select <strong>Custom<\/strong> for a pre-processor.<\/li>\n<li>Add your code for manipulating the request parameters as needed using the following syntax:\n<pre class=\"lang:default decode:true \">{\r\n    \"fields\": {\r\n        \"payloadFields\": { \/\/ to set value to a payload field\r\n            \"key1\": \"value1\", \/\/ Payload fields are not applicable for Alert tasks.\r\n            \"key2\": \"value2\"....\r\n        },\r\n        \"headerFields\": { \/\/ to set value to a header field\r\n            \"key1\": \"value1\",\r\n            \"key2\": \"value2\"....\r\n        },\r\n        \"pathFields\": { \/\/ to set value to a path field or query field.\r\n            \"key1\": \"value1\",\r\n            \"key2\": \"value2\"....\r\n        }\r\n    }\r\n}<\/pre>\n<p>For example, the following code snippet can be used to set the path field or the query field of an API object:<\/p>\n<pre class=\"lang:default decode:true\">var fields= {};\r\nvar pathFields = {};\r\npathFields.fullName = UserContext.get(\"firstName\")+UserContext.get(\"lastName\")\r\nfields.pathFields = pathFields;\r\nvar finalObject = {};\r\nfinalObject.fields = fields;\r\nprint(JSON.stringify(finalObject));<\/pre>\n<p>In the previous code, if <code>firstName<\/code> and <code>lastName<\/code> are stored as session variables, as <code>John<\/code> and <code>Smith<\/code> respectively, then the JSON response payload from the pre-processor would be:<\/p>\n<pre class=\"lang:default decode:true\">{\r\n    fields: {\r\n        \"pathFields\": {\r\n            \"key\": \"fullName\",\r\n            \"value\": \"John Smith\"\r\n        }\r\n    }\r\n}<\/pre>\n<p>In the following pre-processor example, variables are set with session variables prior to the actual API request call.<\/p>\n<pre class=\"lang:default decode:true \">var fields = {};\r\nvar pathFields = {};\r\nvar UserEmailID = UserSession.get(\"rtmEmail\");\r\npathFields.userEmail = UserEmailID;\r\nfields.pathFields = pathFields;\r\nvar finalObject = {};\r\nfinalObject.fields = fields;\r\nprint(JSON.stringify(finalObject));<\/pre>\n<\/li>\n<li>Click <strong>Save<\/strong> to save and close the <strong>Add Processor<\/strong> dialog.<\/li>\n<\/ol>\n<div class=\"alert alert-info\">When a processor is placed in the <strong>Request<\/strong>\u00a0section before the API Request, the processor is considered as a pre-processor. When placed after an API Request, the processor is considered a post-processor.<\/div>\n<h6>Adding a Post-Processor<\/h6>\n<p>You may need more than one API request to get the desired data payload from your web service, using Kore.ai post-processors.<\/p>\n<h4>Define a Custom Post-Processor<\/h4>\n<p>If you want to create a custom post-processor, you could access the response keys of the previous API Request using the following syntax&#8221;<\/p>\n<p class=\"p1\"><span class=\"s1\" style=\"color: #0000ff;\"><i>payload[0].{ key }<\/i><\/span><\/p>\n<h6 class=\"p1\"><strong>JSON Syntax<\/strong><\/h6>\n<pre class=\"lang:default decode:true\">{\r\n \"payload\":\r\n   {\r\n    \"key1\" : \"value1\",\r\n    \"key2\" : \"value2\"\r\n   }\r\n}<\/pre>\n<h6><strong>Example<\/strong><\/h6>\n<pre class=\"lang:default decode:true\">var final = {};\r\nvar data = payload[0]; \/\/Accessing the response of the previous API object\r\ndata.title[0] = 'New value for key here';\r\nfinal.payload = data;  \/\/ Updating the response of the API object\r\nprint(JSON.stringify(final));  \/\/ This step is mandatory<\/pre>\n<p>For custom processors, you must print the final response as shown in the preceding code, otherwise, an empty response is returned. Use the following syntax:<\/p>\n<pre class=\"lang:default decode:true \">print(JSON.stringify( &lt;&lt;object&gt;&gt; ));<\/pre>\n<h4>Configure Standard Post Processors<\/h4>\n<p>Follow these steps to add a standard post-processor:<\/p>\n<ol>\n<li>On the <strong>API Request<\/strong> tab, expand the <strong>Request<\/strong>\u00a0tab, and then click <strong>Add Processor<\/strong>.<\/li>\n<li>Kore.ai also provides a set of standard post-processors that you can use instead of creating custom code for a post-processor. In <strong>Type of Process<\/strong> field, select one of the following four types of standard processors:\n<ol>\n<li><strong>Resolve<\/strong>: You can\u00a0use the results of one payload response as input for a second request. For example, click <strong>Add Processor<\/strong>, enter a <strong>Name<\/strong> for your processor, set <strong>Type of Process<\/strong> to <strong>resolve<\/strong>, and\u00a0<strong>Key<\/strong> to the name of the variable, and then define the <strong>Post\u00a0URL<\/strong> using a variable from the first API Request. For example, <span style=\"color: #0000ff;\">https:\/\/app.asana.com\/api\/1.0\/projects\/<strong>{project_id}<\/strong><\/span>\u00a0that returns the <span style=\"color: #0000ff;\">id<\/span> field in the payload response as:\n<pre class=\"lang:default decode:true\"> ...\r\n\"id\":80468818418144, &lt;br\/&gt;\r\n\"created_at\":\"2016-01-14T05:34:35.848Z\",\r\n\"modified_at\":\"2016-01-20T04:29:52.505Z\",\r\n\"owner\":{\r\n\"id\":73114591129714,\r\n\"name\":\"jaganmohan.evuri\" },\r\n...<\/pre>\n<p>that is then used as a variable input as shown in the following <strong>Post URL<\/strong>:<br \/><span style=\"color: #0000ff;\"> https:\/\/app.asana.com\/api\/1.0\/projects\/<strong>{id}<\/strong>\/tasks?opt_fields=completed,modified_at<\/span><br \/>You must also specify the HTML <strong>Content Type<\/strong> expected in the payload response as well as the HTML <strong>Request<\/strong> method.<br \/>For more information, see <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/using-session-and-context-variables-in-tasks\/\">Using Session and Context Variables in Tasks<\/a>.<\/li>\n<li><strong>Spread<\/strong>: For payloads that contain arrays of data that you need to separate. For example, click <strong>Add Processor<\/strong>, enter a <strong>Name<\/strong> for your processor, set the\u00a0<strong>Key<\/strong>\u00a0field to, for example,\u00a0<strong>data<\/strong>, and <strong>Type of Process<\/strong> to <strong>spread<\/strong>\u00a0to capture the content in the <code>data<\/code> element in the following code example to extract each item of the array.\n<pre class=\"lang:default decode:true\"> {\r\n     \"attribution\": null,\r\n     \"tags\": [],\r\n     \"type\": \"image\",\r\n     \"location\": null,\r\n     \"comments\": {\r\n         \"count\": 51,\r\n         \"data\": [{\r\n             \"created_time\": \"1453900980\",\r\n             \"text\": \"43rd\",\r\n             \"from\": {\r\n                 \"username\": \"kore_hyd\",\r\n                 \"profile_picture\": \"https:\/\/scontent.cdninstagram.com\/t51.2885-19\/11906329_960233084022564_1448528159_a.jpg\",\r\n                 \"id\": \"2056218675\",\r\n                 \"full_name\": \"Kore.ai Hyd\"\r\n             },\r\n             \"id\": \"1171728804843572377\"\r\n         }, {\r\n             \"created_time\": \"1453901222\",\r\n             \"text\": \"44th\",\r\n             \"from\": {\r\n                 \"username\": \"kore_hyd\",\r\n                 \"profile_picture\": \"https:\/\/scontent.cdninstagram.com\/t51.2885-19\/11906329_960233084022564_1448528159_a.jpg\",\r\n                 \"id\": \"2056218675\",\r\n                 \"full_name\": \"Kore.ai Hyd\"\r\n             },\r\n             \"id\": \"1171730841379491107\"\r\n         }, {\r\n             \"created_time\": \"1453901997\",\r\n             \"text\": \"45th\",\r\n             \"from\": {\r\n                 \"username\": \"kore_hyd\",\r\n                 \"profile_picture\": \"https:\/\/scontent.cdninstagram.com\/t51.2885-19\/11906329_960233084022564_1448528159_a.jpg\",\r\n                 \"id\": \"2056218675\",\r\n                 \"full_name\": \"Kore.ai Hyd\"\r\n             },\r\n             \"id\": \"1171737339782450909\"\r\n         }, {\r\n             \"created_time\": \"1453902304\",\r\n             \"text\": \"46th and 47th\",\r\n             \"from\": {\r\n                 \"username\": \"kore_hyd\",\r\n                 \"profile_picture\": \"https:\/\/scontent.cdninstagram.com\/t51.2885-19\/11906329_960233084022564_1448528159_a.jpg\",\r\n                 \"id\": \"2056218675\",\r\n                 \"full_name\": \"Kore.ai Hyd\"\r\n             },\r\n             \"id\": \"1171739915923967873\"\r\n         }, {\r\n             \"created_time\": \"1453902638\",\r\n             \"text\": \"48th\",\r\n             \"from\": {\r\n                 \"username\": \"kore_hyd\",\r\n                 \"profile_picture\": \"https:\/\/scontent.cdninstagram.com\/t51.2885-19\/11906329_960233084022564_1448528159_a.jpg\",\r\n                 \"id\": \"2056218675\",\r\n                 \"full_name\": \"Kore.ai Hyd\"\r\n             },\r\n             \"id\": \"1171742713994497101\"\r\n         }, {\r\n             \"created_time\": \"1453964684\",\r\n             \"text\": \"49th\",\r\n             \"from\": {\r\n                 \"username\": \"venkataphani.ailavarapu\",\r\n                 \"profile_picture\": \"https:\/\/scontent.cdninstagram.com\/t51.2885-19\/11906329_960233084022564_1448528159_a.jpg\",\r\n                 \"id\": \"2679234818\",\r\n                 \"full_name\": \"Phani\"\r\n             },\r\n             \"id\": \"1172263199715314941\"\r\n         }, {\r\n             \"created_time\": \"1453964710\",\r\n             \"text\": \"50th\",\r\n             \"from\": {\r\n                 \"username\": \"kore_hyd\",\r\n                 \"profile_picture\": \"https:\/\/scontent.cdninstagram.com\/t51.2885-19\/11906329_960233084022564_1448528159_a.jpg\",\r\n                 \"id\": \"2056218675\",\r\n                 \"full_name\": \"Kore.ai Hyd\"\r\n             },\r\n             \"id\": \"1172263415747136776\"\r\n         }, {\r\n             \"created_time\": \"1453964717\",\r\n             \"text\": \"51st\",\r\n             \"from\": {\r\n                 \"username\": \"kore_hyd\",\r\n                 \"profile_picture\": \"https:\/\/scontent.cdninstagram.com\/t51.2885-19\/11906329_960233084022564_1448528159_a.jpg\",\r\n                 \"id\": \"2056218675\",\r\n                 \"full_name\": \"Kore.ai Hyd\"\r\n             },\r\n             \"id\": \"1172263474056350986\"\r\n         }]\r\n           ...<\/pre>\n<\/li>\n<li><strong>Extract<\/strong>: For payloads that contain multiple objects, you can specify a path to the specific object. For example, click <strong>Add Processor<\/strong>, enter a <strong>Name<\/strong> for your processor, set the\u00a0<strong>Key<\/strong>\u00a0field to <code>data<\/code>, and then\u00a0<strong>Type of Process<\/strong> to\u00a0<strong>extract<\/strong> to use the object data in the following payload response.\n<pre class=\"lang:default decode:true\">{\r\n    \"user\": {\r\n        \"full_name\": \"Kore.ai Hyd\",\r\n        \"id\": \"2056218675\",\r\n        \"profile_picture\": \"https:\/\/instagramimages-a.akamaihd.net\/profiles\/anonymousUser.jpg\",\r\n        \"username\": \"kore_hyd\"\r\n    },\r\n    ...\r\n}, \"likes\": {\r\n    \"data\": [{\r\n            \"full_name\": \"kstream002\",\r\n            \"id\": \"2100724876\",\r\n            \"profile_picture\": \"https:\/\/instagramimages-a.akamaihd.net\/profiles\/anonymousUser.jpg\",\r\n            \"username\": \"kstream002\"\r\n        }\r\n    },\r\n    ...\r\n}<\/pre>\n<\/li>\n<li><strong>Assign<\/strong>:\u00a0 Using the <strong>Assign<\/strong> processor, you can specify a variable name for the payload response, if needed, for example, when the payload does not contain a key for the payload response data. For example, set <strong>Type of Process<\/strong> to assign, and then in the\u00a0<strong>Output Variable<\/strong>\u00a0field, you can for example, define an output variable for the following payload that is an array of three\u00a0objects.\n<pre class=\"toolbar:1 lang:default decode:true\">[\r\n  {\r\n    \"Cost\": \"$0.00\",\r\n    \"Desc1\": \"$150 bonus after $500 of purchases in the first 3 months from account opening. \",\r\n    \"Desc2\": \"Earn unlimited cash back Earn unlimited 1.5% cash back on every purchase \u00e2\u20ac\u201c it's automatic. Redeem for cash back \u00e2\u20ac\u201c any amount, any time. \",\r\n    \"Keywords\": \"weekend dining,online,groceries,fuel,rewards,rebate,365,allaround\",\r\n    \"OfferName\": \"Freedom Unlimited\",\r\n    \"OfferType\": \"CreditCard\",\r\n    \"Status\": \"1\",\r\n    \"imageURL\": \"http:\/\/www.psdgraphics.com\/file\/credit-card.jpg\",\r\n    \"id\": \"5b5195e264bbd800\"\r\n  },\r\n  {\r\n    \"Cost\": \"$95.00\",\r\n    \"Desc1\": \"Pay 0 balance transfer fee when you transfer a balance during the first 60 days.\",\r\n    \"Desc2\": \"Jumpstart your financial fitness Get an introductory fee for balance transfers, save on interest\u00e2\u20ac , and get your free monthly credit score.\",\r\n    \"Keywords\": \"privileges,rebate,health,wellness,great eastern,insurance,policy,installments,split,cashflo\",\r\n    \"OfferName\": \"Premium Plus\",\r\n    \"OfferType\": \"CreditCard\",\r\n    \"Status\": \"1\",\r\n    \"imageURL\": \"http:\/\/i.imgur.com\/rMOXYql.jpg\",\r\n    \"id\": \"5caf2155873f89c8\"\r\n  },\r\n  {\r\n    \"Cost\": \"$10.00\",\r\n    \"Desc1\": \"Pay 0 balance transfer fee when you transfer a balance during the first 60 days.\",\r\n    \"Desc2\": \"Jumpstart your financial fitness Get an introductory fee for balance transfers, save on interest\u00e2\u20ac , and get your free monthly credit score.\",\r\n    \"Keywords\": \"privileges,rebate,health,wellness,great eastern,insurance,policy,installments,split,cashflo\",\r\n    \"OfferName\": \"Frequent Flyer\",\r\n    \"OfferType\": \"CreditCard\",\r\n    \"Status\": \"1\",\r\n    \"imageURL\": \"http:\/\/www.moneychoice.org\/wp-content\/uploads\/sites\/26\/2016\/01\/credit-card-calculator-image.png.jpeg\",\r\n    \"id\": \"c0b05bc3062658ee\"\r\n  }\r\n]<\/pre>\n<p>In the <strong>Output Variable<\/strong> field, specify a variable to represent the array, as <code>offers<\/code>, for example. If you used the <strong>UX Preview<\/strong>\u00a0feature, the response from Kore.ai would be:<\/p>\n<pre class=\"toolbar:1 lang:default decode:true\">{\r\n  \"response\": {\r\n    \"offers\": [\r\n      {\r\n        \"Cost\": \"$0.00\",\r\n        \"Desc1\": \"$150 bonus after $500 of purchases in the first 3 months from account opening. \",\r\n        \"Desc2\": \"Earn unlimited cash back Earn unlimited 1.5% cash back on every purchase \u00e2\u20ac\u201c it's automatic. Redeem for cash back \u00e2\u20ac\u201c any amount, any time. \",\r\n        \"Keywords\": \"weekend dining,online,groceries,fuel,rewards,rebate,365,allaround\",\r\n        \"OfferName\": \"Freedom Unlimited\",\r\n        \"OfferType\": \"CreditCard\",\r\n        \"Status\": \"1\",\r\n        \"imageURL\": \"http:\/\/www.psdgraphics.com\/file\/credit-card.jpg\",\r\n        \"id\": \"5b5195e264bbd800\"\r\n      },\r\n      {\r\n        \"Cost\": \"$95.00\",\r\n        \"Desc1\": \"Pay 0 balance transfer fee when you transfer a balance during the first 60 days.\",\r\n        \"Desc2\": \"Jumpstart your financial fitness Get an introductory fee for balance transfers, save on interest\u00e2\u20ac , and get your free monthly credit score.\",\r\n        \"Keywords\": \"privileges,rebate,health,wellness,great eastern,insurance,policy,installments,split,cashflo\",\r\n        \"OfferName\": \"Premium Plus\",\r\n        \"OfferType\": \"CreditCard\",\r\n        \"Status\": \"1\",\r\n        \"imageURL\": \"http:\/\/vignette3.wikia.nocookie.net\/objectmayhem\/images\/5\/52\/Credit_card.png\/revision\/latest?cb=20130629150408\",\r\n        \"id\": \"5caf2155873f89c8\"\r\n      }\r\n    ]\r\n  }\r\n}<\/pre>\n<p>With the <strong>Output Variable<\/strong> set to <code>offers<\/code>, you can use the variable as <code>response.offers<\/code> in Bot Builder, for example, in a task response object as follows:<\/p>\n<pre class=\"toolbar:1 lang:default decode:true \">print(JSON.stringify(response));\r\nvar data = response.offers\r\nfor (i = 0; i &lt; data.length; i++) {\r\n    print('&lt;a href=\"' + data[i].imageURL + '\" target=\"_blank\"&gt;' + data[i].OfferName + '&lt;\/a&gt;&lt;br&gt;');\r\n    print(data[i].Desc1)\r\n    print('&lt;br&gt;');\r\n    print('&lt;br&gt;');\r\n    print('Cost: ' + data[i].Cost)\r\n    print('&lt;br&gt;');\r\n    if (i &lt; data.length - 1) {\r\n        print('&lt;br&gt;');\r\n        print('&lt;br&gt;');\r\n    }\r\n}<\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<li>Click <strong>Add<\/strong> to save the API request and then create another, or click <strong>Add &amp; Exit<\/strong> to save the API request and close the dialog.<\/li>\n<\/ol>\n<p>For multiple API requests, you should order the requests in the sequential order needed to get to entire data response. For example, you may need to request a list of workspaces, then a list of projects, and finally, a list of users. Use the <strong>Move\u00a0Up<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"inline\" src=\"\/wp-content\/uploads\/sites\/26\/MoveUpIcon.png\" alt=\"\" width=\"22\" height=\"24\" \/>\u00a0icon and the <strong>Move Down<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"inline\" src=\"\/wp-content\/uploads\/sites\/26\/MoveDownIcon.png\" alt=\"\" width=\"22\" height=\"24\" \/> icon\u00a0to reorder the API requests.<\/p>\n<p class=\"note\"><strong>Note:<\/strong> No confirmation dialog is displayed when deleting an API request. If you click <strong>Continue<\/strong> or <strong>Save<\/strong>, the delete action is permanent and cannot be undone.<\/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<h3><span class=\"ez-toc-section\" id=\"Adding_the_Response_Sample\">Adding the Response Sample<\/span><\/h3>\n<p>In the <strong>Response Sample<\/strong>\u00a0section, you can enter or paste examples of the key-value pairs that you expect to receive in the task payload.\u00a0When you define the response sample, the keys specified\u00a0in the\u00a0<strong>Response Sample<\/strong>\u00a0section are available as drop-down choices for handling the\u00a0output data.<\/p>\n<h4>Adding the Sample Response<\/h4>\n<ol>\n<li>On the <strong>API Request<\/strong> tab, Expand the <strong>Sample Response<\/strong> section.<\/li>\n<li>Enter your Response Sample that contains the key-value pairs from your JSON response payload. Do one of the following:\n<ul>\n<li>To format the view of the response as a JSON structure with indentation as shown in the following\u00a0illustration, click the <strong>Formatted<\/strong> <img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-9801 size-full\" src=\"\/wp-content\/uploads\/sites\/26\/DIYFormattedIcon.png\" width=\"26\" height=\"26\" \/>\u00a0icon.<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/Sample-response-indent.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14126\" src=\"\/wp-content\/uploads\/sites\/26\/Sample-response-indent.png\" alt=\"\" width=\"1051\" height=\"389\" \/><\/a><\/li>\n<li>To format the view of the response in serialized compact form as shown in the following illustration, click the <strong>Unformatted <img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-9802 size-full\" src=\"\/wp-content\/uploads\/sites\/26\/DIYUnFormattedIcon.png\" width=\"26\" height=\"26\" \/><\/strong>\u00a0icon.<\/li>\n<\/ul>\n<\/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=\"Preview_Website_Link_Content\">Preview Website Link Content<\/span><\/h3>\n<p>Some web services send links to preview media as part of the payload response. In this section, you can enable or disable preview links, and define the path to the links in the payload. By default, website preview links are disabled. The following illustration is an example of the <strong>Preview Website Link Content in Post<\/strong> section when <strong>Yes<\/strong> is selected.<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskRESTAPIRequestTabPreview.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9950\" src=\"\/wp-content\/uploads\/sites\/26\/DIYActionTaskRESTAPIRequestTabPreview.png\" alt=\"API Request Tab - Preview Section\" width=\"993\" height=\"711\" \/><\/a> When enabled, define the path to the preview links in the payload in the <strong>Path to the Link(toPreview)<\/strong> field, if the path is not in the root of the payload. For example, in the following code example from an RSS payload, the path to the preview is<\/p>\n<pre class=\"toolbar:1 lang:default decode:true\">...\r\n\"item\": [\r\n    {\r\n        \"title\": \"U.S. to Boost Refugee Intake by 30,000 by 2017\",\r\n        \"guid\": {\r\n            \"-isPermaLink\": \"false\",\r\n            \"#text\": \"SB12418904751422433479504581245034032986752\"\r\n        },\r\n        \"link\": \"http:\/\/www.wsj.com\/articles\/john-kerry-says-u-s-to-admit-30-000-more-refugees-in-next-2-years-1442768498?mod=fox_australian\",\r\n        ...<\/pre>\n<p class=\"p1\">When\u00a0<strong>Preview website link content in Post<\/strong>\u00a0is enabled, select\u00a0preview objects such as:<\/p>\n<ul>\n<li><strong>Preview Title<\/strong> &#8211; Displays the title of the website content.<\/li>\n<li><strong>Preview Description<\/strong> &#8211; Displays the description of the website content.<\/li>\n<li><strong>Preview Media(Video)<\/strong> &#8211; Enables display of video links from the website content.<\/li>\n<li><strong>Preview Media(Image)<\/strong> &#8211;\u00a0Enables display of image\u00a0links from the website content.<\/li>\n<\/ul>\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":"We have seen how an Alert task can be set up in Kore.ai virtual assistant platform\u00a0here. In this section, we will see how to configure an API Request for a REST service. The following illustration is an example of the API Request tab on the Edit Alert \u2013 &lt; Task Name &gt;\u00a0page for an alert\u00a0task...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[],"class_list":["post-27052","post","type-post","status-publish","format-standard","hentry","category-alert"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/posts\/27052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/comments?post=27052"}],"version-history":[{"count":3,"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/posts\/27052\/revisions"}],"predecessor-version":[{"id":27416,"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/posts\/27052\/revisions\/27416"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/media?parent=27052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/categories?post=27052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-2\/wp-json\/wp\/v2\/tags?post=27052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}