Example: Configure an outbound integration

In our inbound integration example, we built an integration that created a notification alert in xMatters when a web request was received from New Relic. In this example, we'll build an outbound integration that starts a new conference bridge in xMatters.

1. Add a new outbound integration

To begin, click the Workflows tab, then click the name of the workflow. Select the Integration Builder tab and add a new outbound integration.

2. Include properties in outbound integrations

In this next step, we'll select the alert properties that we want to send to the outbound integration.

3. Check the request details in the Activity panel

We can use the Activity panel in xMatters to see the input for our integration service. Once we see the content of the webhook, we can transform the content to make sure it does what we want.

4. Transform the content of the webhook

In this step, we'll create a script that will transform the webhook content into an outbound web request that will trigger a form to start a conference bridge.

Our conference bridge form needs to be in the same workflow, and we can add two properties to it that we will populate using the transformation script:

When deployed as a web service, this form can be initiated using a cURL command similar to the following:

curl -1 -H "Content-Type: application/json" --user USERNAME -X POST -d '
{
  "properties": {
    "details": "",
    "Triage Comment": ""
  },
  "recipients": [
    {
       "targetName": "Operations"
    }
  ]
}
' "https://company.na11.xmatters.com/reapi/2015-04-01/forms/370cfaf4-c2d0-4a72-8472-1a10b6e7f2ec/triggers"
 

We need to replicate this cURL command in the transformation script using the built-in HTTP client and endpoints.

5. Check that it works

The final thing to do is to respond to a notification with "P1 Bridge" and make sure everything is working.

This example described how to use an outbound integration to make a request to the xMatters REST API, but the workflow is similar no matters what you want to do. The key steps are:

  • Direct web requests from a form to an outbound integration.
  • Use the transformation script to get the values of alert properties from the webhook.
  • Define an endpoint with the base URL and authentication credentials to use with your HTTP request.
  • Use the HTTP client to define the path of the web service you want to call, relative to the base URL of the endpoint you are using.
  • Construct the body of the HTTP request according to the requirements of the API you are using.
  • Submit the HTTP request.

That's it, we're done!

Over to you now: we can't wait to see what you build.