The notifications API allows you to access and create notifications. To explore Metricly’s REST API and test some requests, go here.

Metricly CLI

The Metricly CLI provides a command-line interface to the Metricly API. See the GitHub page for installation steps.

Swagger

To explore Metricly’s REST API and test some requests, go here. Log in using your Metricly credentials.

Get a List of Your Notifications

This method will automatically return a list of notifications created for the tenant you are authenticated for.

Method GET URL https://api.app.metricly.com/notifications
Parameters Required/Optional Description
N/A N/A N/A

Input JSON Format for Request Header 
Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Create a Notification

This method will create a notification.

Method POST URL https://api.app.metricly.com/notifications
Parameters Required/Optional Description
notification Required Body parameter; see below

Input JSON Format for Request Header 
Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Input JSON Format for Request Body
Attribute Required/Optional Description
notification Required
  • id (optional)
    • The notification ID. If left blank, Metricly will create one for you.
  • tenantId (optional)
    • The ID for the tenant that the notification was created for. If left blank, Metricly will use the Tenant ID associated with your authentication login.
  • enabled (optional)
    • True or false; if the notification is enabled.
  • type (required)
    • The type of notification: email, hipchat, webhook, opsgenie, or pagerduty.
  • properties (required)
    • The fields filled out for each notification type.
      • Email
        Attribute Description
        address Email address used for the notification
        templateType Type of template used (“Custom” or “Default”).
        subjectTemplate Custom template only. The subject of the email to send.
        bodyTemplate Custom template only. The body of the email to send.
      • Hipchat
        Attribute Description
        room The name of the room you want to use for the notification.
        authToken The token for the room you want to use for the notification.
      • opsGenie
        Attribute Description
        name The name of the notification.
        apiKey The API key used to access OpsGenie.
        description The description of the notification.
        teams A comma-delimited list of names of the OpsGenie teams that will receive the notification.
        recipients A comma-delimited list of recipients in OpsGenie that will receive the notification.
        tags A comma-delimited list of tags you want to apply to the OpsGenie alert.
      • PagerDuty
        Attribute Description
        name The name of the notification.
        serviceKey The service key generated by PagerDuty and used in Metricly.
        url The PagerDuty events URL.
      • SNS
        Attribute Description
        name The name of the notification.
        topicArn The Amazon Resource Name (ARN) for the SNS topic.
        awsAuthentication The AWS Authentication type (“role” or “user”).
        iamRole IAM Role authentication only. IAM Role number.
        accessKey Access Key authentication only. The access key for the Amazon user.
      • Slack
        Attribute Description
        name The name of the notification.
        url The webhook URL provided by Slack.
        username The name of the bot that will post the notification to the given Slack channel.
        channel Slack channel override. You can pass in a different channel than the one you specified in Slack(#other-channel-name), another user (@otheruser), or multiple users.
        iconUrl The URL for the icon should you not want to use an emoji icon.
        iconEmoji The name of the emoji you want to use for the icon of the message. You’ll need to pass in a Slack emoji variable (e.g., :smile:, :grin:, etc.
      • WebHook
        Attribute Description
        name The name of the notification.
        url The URL for the webhook.
        basicUsername Username used for authentication with the webhook.
        basicPassword Password used for authentication with the webhook.
        headers Comma-delimited list of headers associated with the webhook.
        payloadType Type of template used (“custom” or “default”).
        postContentTemplate Custom only. The content of the Webhook that’s posted to Metricly.

Test a Notification

This method will allow you to test a notification.

Method POST URL https://api.app.metricly.com/notifications/test
Parameters Required/Optional Description
notification Required Body parameter; see below

Input JSON Format for Request Header 
Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Input JSON Format for Request Body
Attribute Required/Optional Description
notification Required
  • id (required)
    • The notification ID.
  • tenantId (required)
    • The ID for the tenant that the notification was created for.
  • enabled (optional)
    • True or false; if the notification is enabled.
  • type (required)
    • The type of notification: email, hipchat, webhook, opsgenie, or pagerduty.
  • properties (required)
    • The fields filled out for each notification type. See above for more information.
      For an email notification, the properties attribute would contain templateTypeaddressbodyTemplate, and subjectTemplate.

Delete a Notification

This method will delete a given notification.

Method DELETE URL https://api.app.metricly.com/notifications/{id}
Replace {id} in the above URL with a notification ID from any of your notifications.
Parameters Required/Optional Description
id Required URL (path) parameter. Your notification ID.

Input JSON Format for Request Header 
Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Get a Notification by ID

This method will return a notification for the given ID.

Method GET URL https://api.app.metricly.com/notifications/{id}
Replace {id} in the above URL with a notification ID from any of your notifications.
Parameters Required/Optional Description
id Required URL (path) parameter. Your notification ID.

Input JSON Format for Request Header 
Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Replace a notification

This method will allow you to replace a given notification.

Method POST URL https://api.app.metricly.com/notifications/{id}
Replace {id} in the above URL with a notification ID from any of your notifications.
Parameters Required/Optional Description
notification Required Body parameter; see below

Input JSON Format for Request Header 
Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Input JSON Format for Request Body
Attribute Required/Optional Description
notification Required
  • id (required)
    • The notification ID.
  • tenantId (required)
    • The ID for the tenant that the notification was created for.
  • enabled (optional)
    • True or false; if the notification is enabled.
  • type (required)
    • The type of notification: email, hipchat, webhook, opsgenie, or pagerduty.
  • properties (required)
    • The fields filled out for each notification type. See above for more information.
      For an email notification, the properties attribute would contain templateTypeaddressbodyTemplate, and subjectTemplate.
capterra

Join other DevOps who love Metricly!

Sign up for a free, fully featured, 21-day trial. No credit card required!