Only this pageAll pages
Powered by GitBook
1 of 7

Alertifii Docs

Loading...

Loading...

Loading...

Loading...

Loading...

webhook-templates

Loading...

Getting Started

Alertifii makes getting critical app notifications simple!

  • Easy Integration - Easily integrate Alertifii into your web app, network monitor, shell script, or anything else!

  • Critical Notifications - Bypass the device's mute switch and Do Not Disturb Settings.

  • Team Support - Add team members to your account and share on-call responsibility.

Quick Start

  1. Download and install the mobile app.

Package Libraries

  • Node.js + TypeScript -

  • Ruby -

Login to your account on the mobile app.
  • Send a HTTP request or email to your integration endpoint.

  • You should have received a push notification. 🥳

  • Add team members and integrate Alertifii to your other tools.

  • Apple App Store
    Google Play
    https://github.com/PagerTree/alertifii-js
    https://github.com/pagertree/alertifii-ruby

    Mobile Apps

    Alertifii supports both iOS and Android mobile apps. You can download the appropriate app for you phone from the links below:

    • Apple App Store

    • Google Play

    Priorities

    Alerts will be assigned a priority by the that created them. An alert priority will affect how a notification is received on your phone.

    • -2 - Lowest - will not generate any notification. On iOS, the application badge number will be increased.

    • -1 - Low - will not generate any sound or vibration.

    • 0 - Normal (default) - These notifications trigger sound, vibration and display according to the user's device settings. On iOS, the message will display at the top of the screen or as a modal dialog, as well as in the notification center. On Android, the message will scroll at the top of the screen and appear in the notification center.

    Bypass Do Not Disturb

    For notifications to bypass Do Not Disturb they must be high or emergency priority. On iOS, there is no extra configuration needed. For Android, please follow the directions .

    Bypass Do Not Disturb on Android

    On Android, you must also enable the notification channel to bypass do not disturb.

    1. Push and hold the Alertifii App Icon and click App Info

    2. Click Notifications

    3. Click the "Critical (Bypass DND)" channel

    Sounds

    Users can choose from a number of different default sounds to play when receiving notifications, rather than the standard Alertifii tone. Applications can override a user's default tone choice on a per-notification basis.

    When sending notifications through the Alertifii API, the sound parameter may be set to one of the following built-in sounds:

    • alertifii (default)

    • bike

    • bugle

    • cashregister

    SMS Backup

    SMS backup is enabled for emergency priority notifications and will only be sent once, if the alert has not been acknowledged in 5 minutes.

    Phone numbers can be added on the .

  • 1 - High - Bypass a user's do not disturb settings. These messages will always play a sound and vibrate (if the user's device is configured to) regardless of the delivery time.

  • 2 - Emergency - Similar to high-priority notifications, but are repeated until the user acknowledges the notification. These are designed for dispatching and on-call situations where it is critical that a notification be repeatedly shown to the user (or all users of the team that the message was sent to) until it is acknowledged. The first user in a group to acknowledge a message will cancel retries for all other users in the group.

  • Enable the toggle for Override Do Not Disturb

    classical

  • cosmic

  • falling

  • gamelan

  • incoming

  • intermission

  • magic

  • mechanical

  • pianobar

  • siren

  • spacealarm

  • tugboat

  • alien

  • climb

  • persistent

  • echo

  • updown

  • integration
    below
    Profile page

    Account Management

    Billing

    Account billing can be managed from the billing page.

    1. From the right navigation menu, click your account icon.

    2. In the dropdown, click the Billing link.

    Delete

    You must be the account owner to delete an account. If you delete the account, all data will be lost and cannot be restored (this includes all integrations, teams, and alerts).

    1. Navigate to the .

    2. Click View on the account you would like to delete.

    3. Click the Edit Account Button.

    Request Data Deletion

    If you would like to request that only certain data be deleted, please email [email protected] with a description of the exact data you would like deleted.

    Integrations

    Integrations are responsible for taking incoming emails or webhook requests and transforming them into alerts. The process is as follows:

    1. A third-party system sends Alertifii an or to your integration endpoint.

    2. Alertifii creates an alert using the to transform the incoming data.

    Click Delete.
    Click the delete button.
  • If you are sure you want to delete the account, click Confirm.

  • accounts page
    Click the billing link in the nav bar.
    Click the Billing link in the nav bar.
    Click view on the account you would like to delete.
    Click View on the account you would like to delete.
    Click the edit account button.
    Click the Edit Account Button.
    The newly created alert is sent to the
    .
  • The destination determines which user(s) are notified.

  • Alertifii Integration -> Alert Transformation Process

    Endpoints

    Each integration has two endpoints:

    • Email Endpoint - A unique email address that can receive emails.

    • Webhook Endpoint - A unique endpoint that can receive HTTP GET or POST requests.

    Integration Endpoints

    Keep your integration endpoints secret. Anyone with knowledge of the endpoint address can publish to it, possibly creating unwanted alerts in your account.

    Email Endpoint

    To create an alert using the email endpoint, simply send an email to the integration's email endpoint.

    Send an email to the integration endpoint

    The templates should use the following (default):

    • Title Template - <%= request['params']['subject'] %>

    • Body Template - <%= request['params']['body'] %>

    Webhook Endpoint

    To create an alert using the webhook endpoint, simply make a GET or POST request to the integration's webhook endpoint.

    Example of making a GET request (in a web browser) to the webhook endpoint.
    Example making a POST request (in a tool called Postman) to the webhook endpoint.

    By default, the webhook endpoint uses the subject and body parameters sent to it as the title and body of the alerts respectively. However, this can be changed using template to match any body you send to the webhook.

    Templates

    Templates are a way to extract information from incoming request. Templates can use the data sent by your webhook or email to be used for alert fields.

    Template Example

    The following JSON was sent by your 3rd party system to the Alertifii integration endpoint:

    Using the following templates:

    • Title Template - <%= request['params']['custom_field_3'] %>

    • Body Template - <%= request['params']['custom_field_1'] %> - <%= request['params']['custom_field_4'] %>

    The output would be the following:

    • Alert Title - "5xx Error"

    • Alert Description - "error - 500 error observed 10x on www.example.com"

    Destination

    Each integration has one destination. The destination determines which user(s) will be notified of the alert.

    • If the destination is a team, Alertifii sends notifications to all users that are on-call for the team.

    • If the destination is a user, Alertifii will notify the single user.

    Integration Destination

    Maintenance Mode

    Each integration can be put into "maintenance mode". During maintenance mode, integration will no longer create alerts. This is especially helpful if you have a system that gets noisy during known maintenance.

    Enable Maintenance Mode

    1. Click the moon button next to the integration that should enter maintenance mode.

      Maintenance mode button.
    2. Select the duration of how long you would like this maintenance window to last.

      Maintenance mode duration options.
    3. If you are sure, click confirm on the confirm dialog.

    The integration will now appear with a purple moon icon, indicating the integration is in maintenance mode.

    Maintenance mode indicator

    After the selected duration, the maintenance window will automatically be disabled.

    Disable Maintenance Mode

    To disable maintenance mode (before the configured duration)

    1. Click the 'x' next to the purple moon icon.

      Click 'x' on maintenance mode indicator.
    2. If you are sure, click the confirm on the dialog.

      Disable maintenance mode confirm dialog.

    Aggregation

    Alertifii supports simple aggregation. Two fields determine how Alertifii will aggregate alerts:

    1. Aggregate By Template - A template that creates a aggregation key (aka "fingerprint"). Aggregation keys apply across all integrations.

    2. Aggregate For (Minutes) - The duration in minutes to aggregate alerts with this same key.

    Below is the pseudo code that shows how we aggregate alerts:

    Pushover API Adapter

    Alertifii supports a Pushover API adapter so you can simply switch the domain of your existing scripts.

    1. Switch the domain from api.pushover.net -> api.alertifii.com

    2. Change the Pushover token and user to be your integration id (ex: int_abcdefghijklmn)

    POST an HTTPS request to https://api.alertifii.com/1/messages.json with the following parameters:

    • token - (required) - your integration's ID

    • message - (required) - Text to be used as the body of the alert, aswell as the title if no title parameter is passed in.

    • title - (optional) Text to be used as the title of the alert. Defaults to message parameter.

    • user - (optional) - The team or user id to route the alert to. Defaults to integration destination.

    • priority - (optional) - A value between -2 and 2. Defaults to integration priority.

    • sound - (optional) - The name of a supported sound. Defaults to integration sound.

    email
    HTTP request
    templates
    destination
    {
        "custom_field_1": "error",
        "custom_field_2": "example-id-123",
        "custom_field_3": "5xx Error",
        "custom_field_4": "500 error observed 10x on www.example.com"
    }
    # fingerprint and dedup
    if aggregate_by.present? && aggregate_for.present?
      fingerprint = safely(default: nil) { ERB.new(aggregate_by).result_with_hash(hash) }&.strip
    
      # only do fingerprinting if we were able to generate a non-blank fingerprint
      if !fingerprint.blank?
        dup_alert = account.alerts.where(fingerprint: fingerprint).where("created_at > ?", Time.current - aggregate_for.to_i.minutes).first
    
        # if we have a dup, update the existing alert
        # otherwise fingerprint the alert
        if dup_alert
          dup_alert.increment!(:dedup_count)
          alert = nil
        else
          alert.fingerprint = fingerprint
        end
      end
    end
    Click the delete button.
    Enable maintenance mode confirm dialog.

    Grafana

    Connect your Grafana alerts to Alertifii

    Alertifii Grafana Webhook Template

    In Alertifii, modify the integration to use the following templates:

    • Title Template - <%= request['params']['title'] %>

    • Body Template - <%= request['params']['message'] %>

    Grafana Configuration

    Create a Contact Point

    1. In Grafana, navigate to Alerting -> Contact Points.

    2. Click + New contact point button.

    3. In the Create contact point form

    Configure Notification Policy

    1. In Grafana, navigate to Alerting -> Notification Policies

    2. Set the "Root policy" to notify your newly created Alertifii Contact point.

    Teams + On-Call

    A team is simply a group of users. Users from this group can go on-call to be notified of alerts.

    Set an to be a team to notify users currently for a team of incoming alerts.

    If no one is on-call for a team, no one will be notified. Make sure at least one person is always on call for a team.

    Name - Alertifii

  • Contact point type - Webhook

  • URL - Your integration webhook URL

    In Grafana, create the Alertifii contact point.
  • Click Save contact point button.

  • In Grafana, navigate to Alerting -> Contact points.
    In Grafana, navigate to Alerting -> Notification Policies
    Set the Root policy in Grafana to use the Alertifii contact point.
    Join a Team
    1. Click the Join Team button on the team row you wish to join.

      Join team button.
    2. Click confirm on the dialog.

      Join team confirm dialog.

    You are now a part of the team and can join the team's on-call.

    On-Call

    Join a Team's On-Call

    1. You must have joined the team you want to be on-call for.

    2. Click the blue phone button.

      Join on-call button.
    3. Click confirm on the dialog.

      Join on-call confirm dialog.

    You are now on-call for the selected team, and it will be displayed on the team.

    Team row showing current on-call.

    Leave a Team's On-Call

    1. You must have joined a team's on-call if you want to leave on-call for that team.

    2. Click the gray phone button.

      Leave on-call button.
    3. Click confirm on the dialog.

      Leave on-call confirm dialog.
    integrations destination
    on-call
    Team row showing no one currently being on-call.