Webhooks
Testing a Webhook
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
- In the left menu, click Settings > Developer Tools.
- Click Webhooks.
The Webhooks page is displayed. - Click the name of the webhook.
The webhook details page is displayed. - Click Test webhook.
The Test page is displayed. - In the Event to test dropdown, select an event to test.
If no dropdown is available, skip to the next step. - 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 step | Verification |
---|---|
Reception confirmation | Confirm whether the webhook is successfully received at your endpoint, for example, by inspecting the request object. |
Source validation | Confirm that the incoming request originates from the expected source. |
Payload content check | Make sure that the webhook contains the expected alerts. |
Data type validation | Validate 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 verification | Ensure that the webhook corresponds to the anticipated event and the endpoint isn’t associated with the wrong event type. |
Response evaluation | Assess 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 validation | Webhooks 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. |
Related Topics
Was this page helpful?