Set up a Webhook
Overview
In this tutorial, we’ll set up Datadog to send notifications to a Group Chat. Although this tutorial is specific to Datadog, the general approach should apply widely.
Setup requires the following steps:
- Create an API Key.
- Find the ID of your Roam and the Group you want to notify.
- Set up the Webhook in Datadog to authenticate with the key and send to the group.
- Set up a Monitor with the notification conditions and message format.
Create an API key
Create an API key in Roam Administration. See the Quick Start for more detail.
Find the Roam & Group IDs
In Roam Administration, click on Roam. Your Roam ID is displayed at the top of the page, next to your Roam name.
Use the List Groups API endpoint to browse public groups and find the ID of the
group you wish to notify. Using your API key, run the following command:
$ curl -H "Authorization: Bearer $API_KEY" https://api.ro.am/v1/groups.list
Look for the desired group in the output to find the associated ID.
Set up a Webhook in Datadog
-
Navigate to Integrations in the web console and select Webhooks to install and configure it.
-
Create a New Variable for your API Key named
API_KEY. -
Name your Webhook and set the URL to https://api.ro.am/v1/chat.sendMessage
-
Set the Payload to the following, using the Group ID from the last step:
{
"text": "$EVENT_MSG",
"sender": {"name": "Datadog", "id": "datadog"},
"recipients": ["4ff757dd-4954-42d4-b13d-f0dac34d6f7d"]
}
- Set Custom Headers to the following:
{ "Authorization": "Bearer $API_KEY" }
- Save the Webhook.
Set up a Monitor in Datadog
-
Navigate to Monitors > New Monitor and select a type corresponding to the event for which you want to notify.
-
Configure the notification conditions and compose a notification message.
-
In “Notify your services and your team members”, select
webhook-NAMEto deliver notifications using the webhook. -
Save your monitor and click “Test Notifications” to open a dialog allowing you to send webhooks on demand. This is the best way to confirm that everything works and iterate on the notification content.