Testing Webhooks

URL Req for Webhooks

  • URL should be able to handle the incoming request or response. Meaning, the URL should respond with 200 OK to the test 'POST request'.
  • Content of the request can be found in the Sample Content of the Sent Request section below.
  • URL needs to support the HTTPS protocol. A URL with HTTP won't be accepted.
  • Additionally, to make sure the webhooks connection is secure, you can add the generated API key to your system to make sure that the incoming POST request is from Treez. The API key can be found in the webhooks configuration. Refer to Subscribing Webhooks.

Testing Webhook Functionality

If you'd like to test the webhook, but you don't have your own endpoint ready just yet, there are several resources on the Internet that give you the ability to subscribe to Webhook events. For example, you can use https://requestbin.com. Follow the steps below to use requestbin to create the endpoint and test the webhooks

Step 1:

Login and press 'Create a Request Bin'.

Login to RequestBinLogin to RequestBin

Login to RequestBin

Step 2:

Copy the URL generated in the top right corner of the requestbin.

Generating the URLGenerating the URL

Generating the URL

Step 3:

Copy the generated URL into the 'Endpoint' field in Treez (as described in Subscribing to Webhooks)

Registering the URL in Treez to Test and UseRegistering the URL in Treez to Test and Use

Registering the URL in Treez to Test and Use

Step 3:

Check the response in requestbin.com. Observe the request sent to this URL.

Response received at the registered URL.Response received at the registered URL.

Response received at the registered URL.

This marks a successful subscription to webhooks. Once you set up API Webhooks in Treez, all the notifications sent can be checked/received at the URL.

Common Error - Test Failed

When setting up a webhook in Treez, after entering the URL, click 'Test'. A test event is sent to make sure that the URL is reachable. For the test to pass, we receive 200 OK as a response. For example, if we send this event to https://www.youtube.com and we receive 200 OK as a response, the URL has been accepted and the webhook can be saved. However, if the URL is not meant to receive/handle the sent request you might see an error 'Test Failed'.

  • The error message 'Test Failed' can appear if the URL is not able to handle the response.
  • If you see 'Test Failed', you can also check if API token is not supported/specified in the URL.

Did this page help you?