Notification Webhook Configuration Examples

Example of OpsGenie Notification webhook setup.

This configuration enables the integration of OpsGenie with the CAST AI console, ensuring that alerts are received in OpsGenie.

OpsGenie pre-requisite

Add an API integration

  1. Go to Settings → Integrations.
  2. Run a search and select “API”.
  3. On the next screen, enter a name for the integration.
  4. Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration. Learn how alert notifications flow in Opsgenie.
  5. Select Continue.
    The integration is saved at this point.
  6. Expand the Steps to configure the integration section and copy the API key for use in your API requests.
  7. Select Turn on integration.
    The rules you create for the integration will work only if you turn on the integration.
API key integration example

API key integration example

Define rules for creating and processing alerts

The configuration of an API integration involves defining many different alert scenarios. These scenarios specify how and when alerts can be created, closed, acknowledged, etc. The integration comes with a default set of alert creation and processing rules; you can customize them and add as many rules of your own as you like. For example, you can add three rules for create alert, which means the incoming data is evaluated against these three scenarios in order, and if one of them matches, an alert is created.

Alert rules example

Alert rules example

OpsGenie Integration

Add a Webhook integration

  1. Go to Settings > Integrations.
  2. Select Add integration.
  3. Run a search and select “Webhook”.
  4. On the next screen, enter a name for the integration.
  5. Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.
  6. Select Continue.
    The integration is saved at this point.
  7. Select Turn on integration.
    The rules you create for the integration will work only if you turn on the integration.

Sending alert description and alert details is only available for Create and Custom actions.

Webhook integration example

Webhook integration example

Webhook configuration

Utilize the provided API integration key to configure your webhook integration, ensuring it is utilized for authentication purposes.

=

Webhook integration validation

Before entering the essential details into the CAST AI webhook configuration, we recommend executing the following curl command. This action will verify whether the configured integration receives alerts and notifications as anticipated:

curl -X POST "<https://api.opsgenie.com/v2/alerts">  
    -H "Content-Type: application/json"  
    -H "Authorization: GenieKey <API Key>"  
    -d '{"message": "An example alert message"}'  
Alert within OpsGenie should be triggered:\`
OpsGenie Alert

OpsGenie Alert

CAST AI Integration

Add webhook via CAST AI console

  • Navigate to Notifications > Add Webhook

  • Set up the fields below using the information collected from the Webhook and API integration

    • Name of Webhook
    • Callback URL
    • Category
    • Severity
    • Request template
    • Authorization keys (Headers)
Webhook “Can connect” example

Webhook “Can connect” example


Example of MS Teams Notification webhook setup.

This configuration enables the integration of MS Teams with the CAST AI console, ensuring that alerts are received in MS Teams.

MS Teams Integration

Create an Incoming Webhook:

  1. In the New Teams client, select Teams  and navigate to the channel where you want to add an Incoming Webhook.

  2. Select More options ••• on the right side of the channel name.

  3. Select Manage channel.

  4. Select Edit.

  5. Search for Incoming Webhook and select Add.

  6. Select Add.

📘

If you’ve already added an Incoming Webhook, the Configure option appears. Select Configure to create an Incoming Webhook.

  1. Provide a name for the webhook and upload an image if necessary.

  2. Select Create.

  3. Copy and save the unique webhook URL present in the dialog. The URL maps to the channel and you can use it to send information to Teams.

  4. Select Done. The webhook is now available in the Teams channel.

CAST AI Integration

Add webhook via CAST AI console

  • Navigate to Notifications > Add Webhook

  • Set up the fields below using the information collected from the Webhook and API integration
    • Name of Webhook
    • Callback URL
    • Category
    • Severity
    • Request template
    • Authorization keys (Headers)

Test Notification