Connecting Webhooks to All Quiet: An Integration Guide with cURL

Image

Published: Wednesday, 22 November 2023

🔗 Simplify Webhook Integrations: Discover how to seamlessly connect any webhook to All Quiet using cURL in our straightforward guide, enhancing your incident management process.

Integrating webhooks with All Quiet is a straightforward process designed for efficiency and simplicity. This blog post will guide you through the steps of using a cURL request to connect a webhook with All Quiet, enabling the immediate and automated transfer of data between systems. The focus will be on practical implementation, ensuring that by the end, you will be equipped with the knowledge to set up this integration smoothly.

Create Webhook Integration

Click on Integrations > Inbound to navigate, then select Create Integration to initiate a new integration setup.

  1. Provide a Display Name for your integration, for example, "My Webhook".
  2. Select your team from the dropdown menu.
  3. For the integration type, choose "Webhook".
  4. Click on the "Create integration" button to finalize the setup.

Send POST with cURL

  1. Access the details page of your newly created integration to locate the unique Webhook URL. This URL is utilized for sending HTTP requests.
The Webhook accepts all HTTP Verbs and supports the following values for the HTTP header Content-Type:
  • application/json maps to property jsonBody
  • application/x-www-form-urlencoded maps to property formBody
  • multipart/form-data maps to property formBody
  • text/plain maps to property textBody
  • text/xml, application/xml and application/xhtml+xml map to property xmlBody

Use the CURL command below as an example to trigger the webhook:


                curl -X POST 'https://allquiet.app/api/webhook/8fa1637f-cafa-4a5d-8bb8-af1dd5caaf2f' \
                -H 'Content-Type: application/json' \
                -d '{"alertName": "My Monitor", "alertStatus": "Failed", "description": "From cURL"}'
            

Inspect your Webhook payload.

Once the cURL command has been executed, the corresponding payload will be visible on your integration's details page.

  1. To view a specific payload, click the "Select" button next to the desired entry under "Latest payloads". This action will load the payload into the "Request Payload Example" section for review.
  2. The "Request Payload Example" field displays the actual payload generated by your cURL command. Here you can adjust the mapping of attributes to tailor it to your specific needs.
    Tip: The JSON content can be manually edited within this field to test different payload scenarios.

Configure Attribute Mapping

If the payload has not been modified from the previous cURL example, the webhook's default attribute mapping should seamlessly translate the data into an All Quiet incident.

Our example payload includes an additional field description which we will map to the incident attributes in the subsequent step.

To integrate the description field into your incident mapping, use the following JSON mapping code:

{ "name": "Description", "mappings": [{ "jsonPath": "$.jsonBody.description" } ]}

  1. Insert the JSON mapping code above for the Description attribute into the attributes array.
  2. Once added, the "Description" field will display in the incident preview, showing the mapped value.

Read all blog posts and learn about what's happening at All Quiet.