Overview

We recommend testing your webhook after creating them to ensure the proper functioning and integration of your subscriptions. This topic provides instruction to test the webhook URL with example data.

Prerequisites

Before creating a webhook, ensure that you have Developer Admin privileges to test webhooks. For more information on privileges, see the Role-Based Access Control topic.

Procedure

  1. In the left menu, click Settings > Developer Tools.
  2. Click Webhooks.
    The Webhooks page is displayed.
  3. Click the name of the webhook.
    The webhook details page is displayed.
  4. Click Test webhook.
    The Test page is displayed.
  5. In the Event to test dropdown, select an event to test.
    If no dropdown is available, skip to the next step.
  6. Click Run Test.

Depending on the webhook configuration, one of the following response with the result of the test is returned, indicating whether the test was successful or not:

  • 200 Ok
  • 400 Bad request
  • 401 Unauthorized
  • 404 Subscription/Event type not found
  • 500 Internal Server Error

The following provides a list of possible reasons webhooks can fail.

Troubleshooting stepVerification
Reception confirmationConfirm whether the webhook is successfully received at your endpoint, for example, by inspecting the request object.
Source validationConfirm that the incoming request originates from the expected source.
Payload content checkMake sure that the webhook contains the expected alerts.
Data type validationValidate the data types of the received information. In some instances, data may be formatted differently from what your server expects. For example, a boolean value sent as a string could lead to unintended issues. If necessary, transform the data to match your server’s expectations.
Event verificationEnsure that the webhook corresponds to the anticipated event and the endpoint isn’t associated with the wrong event type.
Response evaluationAssess how your API responds to the webhook. Make sure that the webhook is processed correctly, and that the appropriate status codes are returned as required by your application.
Authentication validationWebhooks might fail if you don’t fulfill their authentication criteria. Ensure that you adhere to the authentication protocols as set up in the Authorization field of the Add Webhook page in Copilot.