Configuring the Alert Task Request Object - Webhook

After you define the basic settings and authentication for an alert task, you are ready to start configuring the request object that asks for data from your Bot website or web application.

The options to define for the request object are based on the Connection Type specified for the task. One of:

  • Webhook - The web application pushes data for the alert task to Kore.
  • RSS - The web services sends data to Kore with polling.
  • Webservice - The web service sends data to Kore when polled by Kore.

This topic describes how to define the request object for a task with the Connection Type specified as Webhook.

What Do I Need to Do?

For a task with the Connection Type specified as Webhook, you will need to define:

  • The web service Content Type exchanged between Kore and your web application.
  • The keys expected in the response payload to your request.
  • The alert task path in the response payload.

The following section describes how to configure an alert task using a webhook. To learn how to configure the request object for an alert task with a Connection Type set to webservice or RSS, see Configuring the Alert Task Request Object - Webservice or Configuring the Alert Task Request Object - RSS.

Webhook Alert Task Request Object Configuration

This section describes how to configure the request object for an alert task where the Connection Type is defined as Webhook. The Connection Type determines the parameters displayed in the Configure the Alert Task Request dialog. The following illustration is an example of a configuration for an alert task with the Connection Type defined as Webhook.

To get started for a webhook configuration of the task request object, you must define the Content Type exchanged between Kore and your Bot website or application, and the key/value pairs expected in the task payload response.

In the Content Type field, select one of the following supported data types for your sample response data.

  • JSON - 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 servers and your Bot web application. 
  • RSS - 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.
  • XML - Extensible Markup Language is a markup language that defines a set of rules for encoding documents in a format which is both human-readable and machine-readable. Oftentimes, Web Services use XML schemas to process the XML data.
  • URL Encoded JSON - URLs using JSON encoding for reserved characters.
  • CSV - Comma-separated value lists.
  • Text - Text-based key value pairs.
  • Twitter Encoded JSON - URLs for Twitter using JSON encoding for reserved characters.

Adding Sample Response Data

In the Sample Response Data field, enter or paste examples of the key value pairs that you expect to receive in the task payload. When you define the task response object, the keys specified in the Sample Response Data field are available as drop-down choices for handling the data to display to the end-user.

To format the view of the response as a JSON structure with indentation as shown in the previous illustration, click the Formatted  icon.

To format the view of the response in serialized compact form as shown in the following illustration, click the Unformatted  icon.

Defining the Alerts Path

The last field, Alerts Path, is an optional field that you can specify if the Sample Response Data field contains a hierarchical tree structure of data and you only want a specific hierarchical level submitted for the task request object. 

For example, in the following sample response data, you may only want to expose the user data in the alert task response by defining user in the Alerts Path field.

{
"user": {
"timeZone": "Asia/Kolkata",
"active": "true",
"displayName": "John Doe",
"avatarUrls": {
"32x32": "https://koreteam.atlassian.net/secure/useravatar?size=medium&ownerId=john.doe&avatarId=11801",
"16x16": "https://koreteam.atlassian.net/secure/useravatar?size=xsmall&ownerId=john.doe&avatarId=11801",
"24x24": "https://koreteam.atlassian.net/secure/useravatar?size=small&ownerId=john.doe&avatarId=11801",
"48x48": "https://koreteam.atlassian.net/secure/useravatar?ownerId=john.doe&avatarId=11801"
},
"emailAddress": "john.doe@kore.com",
"key": "john.doe",
"name": "john.doe",
"self": "https://koreteam.atlassian.net/rest/api/2/user?username=john.doe"
},
"webhookEvent": "jira:issue_updated",
"timestamp": "1438431826045",
"user_key": "john.doe",
"user_id": "john.doe"
}

Next Steps

After you enter the sample response data, click Continue, or Save when editing task to move to the Response Object page. For more information, see Configuring the Alert Task Response Object.

Comments