How Can We Help?

Introduction

A webhook is a web callback which sends data to the applications. Webhook is used for sending notifications. It is an automated message having a payload and is sent to an unique registered URL. You can connect two different applications using webhook. Whenever an application triggers an event, it sends details to the webhook URL.

Webhook Plugin

You can register a callback URL for an account Id in HEAL. HEAL server should be able to reach the URL. When an event occurs for an account, webhook plugin checks if a callback URL is registered for the account. If an URL is registered, it calls the URL with the payload. Using the registered URL, webhook plugin pushes the events details. Plugin delivers the events at the endpoints. Endpoint needs to be running in your application to receive the events.

Prerequisites

Prerequisites to use the Webhook APIs are as follows:

  • Access to HEAL Keycloak server to generate Authorization token.
  • Curl must be installed in HEAL keycloak server.
  • The identifier of the Account for your Enterprise must be obtained.

Webhook API Request Details

Base URI

Webhook APIs use the following base URI:

https://<keycloak_host>:<keycloak_port>/v2.0/api

  • keycloak_host: IP Address or Host name of the server, where Keycloak is installed.
  • keycloak_port: Port number on which Keycloak is running.

Request Structure

HTTP MethodPOST, GET, PUT, DELETE
Request Header
Authorization TokenKeycloak token from HEAL Server.

Authorization Token

To generate the Authorization token for the API request header, execute following steps:

  1. Log in to the HEAL Keycloak Server.
  2. Execute the following command:

curl -X POST -d “client_id=<id>” -d “username=<controlcenter_username>” -d “password=<controlcenter_password>” -d “grant_type=<type>” https://<keycloak_hostname>:<keycloak_port>/auth/realms/master/protocol/openid-connect/token

where the value of client_id and grant_type must be replaced with admin-cli and password respectively. Provide HEAL Control Center Admin Username and Password as values of username and password fields.

Example:

curl -X POST -d “client_id=admin-cli” -d “username=appsoneadmin” -d “password=xxxxxxx” -d “grant_type=password” http://xrtravelskc:8082/auth/realms/master/protocol/openid-connect/token

Managing Webhook Subscriptions

Creating a Webhook Subscription

Registers a callback URL to receive HEAL events.
API Name – webhook
Format – POST /config/accounts/{accountId}/webhook

Input Json Format

{ “url”: “<Callback URL>”, }

IP address in the url should be IP of the server which receives events from HEAL. Port number should contain the port where the server runs.

Input Parameters

TypeNameDescriptionSchemaMandatory/Optional
PathaccountIdID or Identifier of an AccountstringMandatory

 

Sample Input

http://<keycloak_host>:<keycloak_port>/v2.0/api/5/webhook

Sample Input Json

{ “url”: “localhost:4000/action” }

Sample Success Response

{ “message”: “Operation successfully completed.”, “responseStatus”: “SUCCESS”, “data”: null }

Retrieving a Webhook Subscription

Fetches the registered callback URL for an account.
API Name – webhook
Format – GET /config/accounts/{accountId}/webhook

Input Parameters

TypeNameDescriptionSchemaMandatory/Optional
PathaccountIdID or Identifier of an AccountstringMandatory

 

Sample Input

http://<keycloak_host>:<keycloak_port>/v2.0/api/5/webhook

Sample Success Response

{ “message”: “Operation successfully completed”, “responseStatus”: “SUCCESS”, “data”: [ { “id”: 2, “url”: “localhost:4000/action”, “createdTime”: 158650748200, “updatedTime”: 158650748200, “userDetailsId”: “7640123a-fbde-4fe5-9812-581cd1e3a9c1”, “accountId”: 5 } ] }

Updating a Webhook Subscription

Updates the registered callback URL for an account.
API Name – webhook
Format – PUT /config/accounts/{accountId}/webhook

Input Json Format

{ “url”: “<Callback URL>”, }

Input Parameters

TypeNameDescriptionSchemaMandatory/Optional
PathaccountIdID or Identifier of an AccountstringMandatory

 

Sample Input

http://<keycloak_host>:<keycloak_port>/v2.0/api/5/webhook

Sample Input Json

{ “url”: “https://myserver.com/callback” }

Sample Success Response

{ “message”: “Operation successfully completed.”, “responseStatus”: “SUCCESS”, “data”: null }

Deleting a Webhook Subscription

Unregisters the callback URL which was registered earlier for an account.
API Name – webhook
Format – DELETE /config/accounts/{accountId}/webhook

Input Parameters

TypeNameDescriptionSchemaMandatory/Optional
PathaccountIdID or Identifier of an AccountstringMandatory

 

Sample Input

http://<keycloak_host>:<keycloak_port>/v2.0/api/5/webhook

Sample Success Response

{ “message”: “Operation successfully completed.”, “responseStatus”: “SUCCESS”, “data”: null }

Event Details

Once you register a callback URL for an account in HEAL, your application listening to the events on an endpoint receives following details for an event –

FieldDescription
Signal_IDUnique identifier of the Signal
Signal_TypeType of a Signal. It can be either a Problem or an Early Warning.
Signal_DescriptionDescription of the Signal
Signal_StatusOpen/Upgraded/Closed
SeveritySeverity of a signal. It can be either Severe or Default
App_NamesList of application names affected by the Signal.
Related_SignalsApplicable only if Signal_Type is Problem
StartTimeStart time of the Signal
EndTimeEnd time of the Signal
UsernameName of the HEAL user
Organization_NameAccount Name
EntryPoint_ServiceNameName of an entry point service
RootCause_ServiceNamesName of a service which is the root cause of this Signal
Affected_ServiceNamesList of affected service names
Affected_ApplicationNamesList of affected application names
Total_EventsCount of the events occurred
Latest_EventsLatest Event ID
Latest_Event_TimeTimestamp of the latest event
Latest_Events_DetectedEvent details of latest detected event
A1ProtocolHEAL Protocol
A1HostAddressHost name or IP address of HEAL
A1PortPort number where HEAL server runs
AccountIdentifierUnique identifier of an account in HEAL
Table of Contents