HTTP Notification for Alert rules

Alert rule notification API allows you to set up and view details for HTTP notifications. Create a JWT using the following scope to use the alert rule notification API.

Scope name

Function

alertrules:write

alertrules:read

To view details of HTTP Notification

Setup Alert HTTP Notification using API

To setup alert HTTP notifications, use /pluggables/Notification/HTTPNotification/create_api.

Endpoint URL

https://Logpoint-IP/pluggables/Notification/HTTPNotification/create_api

Method

POST

Request Headers

  • Content-Type = application/json

  • Authorization = Bearer <TOKEN>

Parameters

Parameters are data sent with the API request to retrieve information. You must include them in the request body as raw text.

Field

Type

Description

type

string

Alert rule notification type. Must be http. Optional Field.

http_url

string

IP address or domain name where the HTTP request must be sent. Mandatory Field.

Example: http://example.comarrow-up-right , https://8.8.8.8arrow-up-right

http_request_type

string

The HTTP method to be used for the request, including POST, GET, PUT, DELETE, PATCH, or HEAD. Mandatory Field.

http_querystring

string

Query string to include in the request URL, like information about the logs. Optional Field.

notify_http

boolean

Whether to enable or disable HTTP notification. By default, it is true. Optional Field.

http_format_query

string

Formatted value of http_querystring to include in the request URL.

For example: If you add http_querystring = ”x=34&y={{foo|date}}”, where, ‘foo’ is a reserved Jinja placeholder, it is formatted as http_format_query = “x34&y={{foo| date(format, timezone)}}”

The timezone and date format is used according to what the user selected in their User Preference.

Optional Field.

http_body

string

The body content of the HTTP request. You must input JSON string. Optional Field.

protocol

string

Protocol used for the notification: HTTP or HTTPS. By default, it is HTTP. Optional Field.

dispatch_option

string

Option to send notification when the alert is triggered:

  • auto to send a notification every time the alert rule is triggered.

  • manual to manually send the notification from the incident actions.

By default, it is auto. Optional Field.

http_header

Object

Custom HTTP headers to include in the request for authentication.

Must be one of the following in additionalProp1:

  • { "auth_type" : "api_token", "auth_key": "foo", "auth_value": "bar" }

  • { "auth_type" : "basic_auth", "auth_key": "foo", "auth_pass": "bar" }

  • { "auth_type" : "bearer_token", "auth_key": "foo"}

  • { "auth_type" : "None"}

Optional Field.

http_threshold_value

integer

Number of incidents that must be triggered before sending the HTTP notification. Optional Field.

http_threshold_option

string

Option to set the time for the http_threshold_value. Either minute, hour, or day. Optional Field.

ids

array of strings

Ids of the created Alert Rules. Get the list of ids from List API. Mandatory field.

Request Example:

A successful response returns an HTTP status code 200, and a validation error returns a 422 status code. For a validation error, the response body includes errors in a nested format, allowing you to identify the error field.

Success Response:

Validation Error Response:

View Alert HTTP Notification using API

To view an alert HTTP notification, use /pluggables/Notification/HTTPNotification/read_api.

Endpoint URL

https://Logpoint-IP/pluggables/Notification/HTTPNotification/read_api

Method

GET

Request Header

Authorization = Bearer <TOKEN>

Parameters

Parameters are data sent with the API request to retrieve information. You must include it in parameters as Key and Value.

Field

Type

Description

id

string

Ids of the created Alert Rules. Get the list of ids from List API. Mandatory Field.

Request Example:

A successful response returns an HTTP status code 200, and a validation error returns a 422 status code. For a validation error, the response body includes errors in a nested format, allowing you to identify the error field.

Success Response:

Validation Error Response:

Last updated

Was this helpful?