{"id":27048,"date":"2021-03-17T06:08:39","date_gmt":"2021-03-17T06:08:39","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-2\/?p=27048"},"modified":"2022-09-27T15:17:04","modified_gmt":"2022-09-27T14:17:04","slug":"alert-task-webhook-api-request","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-2\/docs\/bots\/bot-builder-tool\/alert\/alert-task-webhook-api-request\/","title":{"rendered":"Alert Task \u2013 WebHook API Request"},"content":{"rendered":"<p><span style=\"font-weight: 400\">In this article, we will see how to configure an API Request for a WebHook service Alert Task.You can learn more about Alert Tasks <\/span><a href=\"https:\/\/developer.kore.ai\/v10-2\/docs\/bots\/bot-builder-tool\/alert\/notification-tasks\/\"><span style=\"font-weight: 400\">here<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">For an Alert task with the <\/span><strong>Connection Type<\/strong><span style=\"font-weight: 400\"> specified as <\/span><strong>Webhook<\/strong><span style=\"font-weight: 400\">, you will need to define:<\/span><\/p>\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>\n<h1><span class=\"ez-toc-section\" id=\"Content_Type\"><span style=\"font-weight: 400\">Content Type&nbsp;<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">The <\/span><strong>Content Type <\/strong><span style=\"font-weight: 400\">describes the type of data exchanged between the XO Platform and your website or application, and the key-value pairs expected in the task payload response. To define the Content Type for the API Request, expand the <\/span><strong>Content Type<\/strong><span style=\"font-weight: 400\"> tab and select one of these options:<\/span><br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122522\/select-content-type.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122522\/select-content-type-1024x333.png\" alt=\"\" width=\"640\" height=\"208\" class=\"alignnone size-large wp-image-45671\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122522\/select-content-type-1024x333.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122522\/select-content-type-300x98.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122522\/select-content-type.png 1615w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<ol>\n<li style=\"font-weight: 400\"><strong>JSON<\/strong><span style=\"font-weight: 400\"> &ndash; JavaScript Object Notation is an open standard format using human-readable text to transmit data objects as attribute-value pairs. You can use JSON to transmit data between the Kore.ai servers and your web application.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>RSS<\/strong><span style=\"font-weight: 400\"> &ndash; 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.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>XML<\/strong><span style=\"font-weight: 400\"> &ndash; 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.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>URL Encoded JSON<\/strong><span style=\"font-weight: 400\"> &ndash; URLs using JSON encoding for reserved characters.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>CSV<\/strong><span style=\"font-weight: 400\"> &ndash; Comma-separated value lists.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Text<\/strong><span style=\"font-weight: 400\"> &ndash; Text-based key-value pairs.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Twitter Encoded JSON<\/strong><span style=\"font-weight: 400\"> &ndash; URLs for Twitter using JSON encoding for reserved characters.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Multipart\/Form-data<\/strong><span style=\"font-weight: 400\"> &ndash; 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<\/span><strong>.<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>Multipart\/Related<\/strong><span style=\"font-weight: 400\"> &ndash; Used when the same information is presented in different body parts in different forms. The body parts are ordered by increasing complexity.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Oracle ADF<\/strong><span style=\"font-weight: 400\"> &ndash; For Oracle Application Development Framework.<\/span><\/li>\n<\/ol>\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>\n<h1><span class=\"ez-toc-section\" id=\"The_Sample_Response\"><span style=\"font-weight: 400\">The Sample Response<\/span><\/span><\/h1>\n<p><strong>The Sample<\/strong> <strong>Response <\/strong><span style=\"font-weight: 400\">section lets you define key-value pairs that you expect to receive in the <\/span><span style=\"font-weight: 400\">Alert <\/span><span style=\"font-weight: 400\">task payload. The keys that you provide are available as drop-down choices for handling the data to display to the end-user. When you define the response sample, the keys specified in the <\/span><strong>Response Sample<\/strong><span style=\"font-weight: 400\"> section are available as drop-down choices for handling the output data.<\/span><span style=\"font-weight: 400\"><br \/><\/span><span style=\"font-weight: 400\">To Add a Sample Response<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the <\/span><strong>API Request<\/strong><span style=\"font-weight: 400\"> tab, expand the <\/span><strong>Sample Response<\/strong><span style=\"font-weight: 400\"> section.<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Enter your Response Sample<\/strong><span style=\"font-weight: 400\"> that contains the key-value pairs from your JSON response payload. Do one of the following:<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">To format the view of the response as a JSON structure with indentation as shown in the following illustration, click the <\/span><strong>Formatted<\/strong><span style=\"font-weight: 400\"> icon.<\/span><\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122715\/edit-response.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122715\/edit-response-1024x379.png\" alt=\"\" width=\"640\" height=\"237\" class=\"alignnone size-large wp-image-45675\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122715\/edit-response-1024x379.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122715\/edit-response-300x111.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122715\/edit-response.png 1051w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">To format the view of the response in serialized compact form, click the <\/span><strong>Unformatted<\/strong> <span style=\"font-weight: 400\">icon.<\/span><\/li>\n<\/ol>\n<\/li>\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>\n<h1><span class=\"ez-toc-section\" id=\"Alert_Tasks_Path\"><span style=\"font-weight: 400\">Alert Tasks Path&nbsp;<\/span><\/span><\/h1>\n<p><strong><br \/><\/strong><span style=\"font-weight: 400\">The last section, <\/span><strong>Alert Tasks Path lets you <\/strong><span style=\"font-weight: 400\">define a specific path for data from the API. This is an optional field that you can use to specify if the <\/span><strong>Response Sample<\/strong><span style=\"font-weight: 400\"> section contains a hierarchical tree structure of data and you only want a specific hierarchical level submitted for the task request object.<\/span><\/p>\n<p><\/span><span style=\"font-weight: 400\">To define the <\/span><strong>Alert Tasks Path<\/strong><span style=\"font-weight: 400\"> for an alert task using a webhook, on the <\/span><strong>API Request<\/strong><span style=\"font-weight: 400\"> tab, click the <\/span><strong>Expand<\/strong> <span style=\"font-weight: 400\"> icon in the <\/span><strong>Alert Tasks Path<\/strong><span style=\"font-weight: 400\"> section as shown in the fo&lt;llowing illustration.<\/span><\/p>\n<p>a href=&#8221;https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122821\/alert-task-path.png&#8221;&gt;<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122821\/alert-task-path-1024x141.png\" alt=\"\" width=\"640\" height=\"88\" class=\"alignnone size-large wp-image-45678\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122821\/alert-task-path-1024x141.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122821\/alert-task-path-300x41.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-2\/wp-content\/uploads\/sites\/45\/20220927122821\/alert-task-path.png 1297w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><br \/>\n<\/span><span style=\"font-weight: 400\">For example, in the following <\/span><strong>Response Sample<\/strong><span style=\"font-weight: 400\">, you may only want to expose the <\/span><span style=\"font-weight: 400\">user<\/span><span style=\"font-weight: 400\"> data in the alert task response by defining the <\/span><span style=\"font-weight: 400\">user<\/span><span style=\"font-weight: 400\"> in the <\/span><strong>Alert Tasks Path<\/strong><span style=\"font-weight: 400\"> field.<\/span><\/p>\n<table style=\"width: 100%;border-collapse: collapse;background-color: #f7f7f7;height: 18px\">\n<tbody>\n<tr style=\"height: 18px\">\n<td style=\"width: 100%;height: 18px\"><code>{<\/code><br \/><code>&nbsp;&nbsp;&nbsp;\"user\":{<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"timeZone\":\"Asia\/Kolkata\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"active\":\"true\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"displayName\":\"John Doe\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"avatarUrls\":{<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"32x32\":\"https:\/\/koreteam.atlassian.net\/secure\/useravatar?size=medium&amp;ownerId=john.doe&amp;avatarId=11801\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"16x16\":\"https:\/\/koreteam.atlassian.net\/secure\/useravatar?size=xsmall&amp;ownerId=john.doe&amp;avatarId=11801\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"24x24\":\"https:\/\/koreteam.atlassian.net\/secure\/useravatar?size=small&amp;ownerId=john.doe&amp;avatarId=11801\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"48x48\":\"https:\/\/koreteam.atlassian.net\/secure\/useravatar?ownerId=john.doe&amp;avatarId=11801\"<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"emailAddress\":\"john.doe@kore.com\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"key\":\"john.doe\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"name\":\"john.doe\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"self\":\"https:\/\/koreteam.atlassian.net\/rest\/api\/2\/user?username=john.doe\"<\/code><br \/><code>&nbsp;&nbsp;&nbsp;},<\/code><br \/><code>&nbsp;&nbsp;&nbsp;\"webhookEvent\":\"jira:issue_updated\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;\"timestamp\":\"1438431826045\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;\"user_key\":\"john.doe\",<\/code><br \/><code>&nbsp;&nbsp;&nbsp;\"user_id\":\"john.doe\"<\/code><br \/><code>}<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\"><br \/><\/span><span style=\"font-weight: 400\"> &nbsp; <\/span><span style=\"font-weight: 400\">After you enter the <\/span><strong>Alert Tasks Path<\/strong><span style=\"font-weight: 400\"> field, click <\/span><strong>Save<\/strong><span style=\"font-weight: 400\">.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will see how to configure an API Request for a WebHook service Alert Task.You can learn more about Alert Tasks here. For an Alert task with the Connection Type specified as Webhook, you will need to define: Content Type&nbsp; The Content Type describes the type of data exchanged between the XO&#8230;<\/p>\n","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-27048","post","type-post","status-publish","format-standard","hentry","category-alert"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/posts\/27048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/comments?post=27048"}],"version-history":[{"count":5,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/posts\/27048\/revisions"}],"predecessor-version":[{"id":45740,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/posts\/27048\/revisions\/45740"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/media?parent=27048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/categories?post=27048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/tags?post=27048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}