Testing Webhooks

Once you've implemented a Webhook handler and registered it within the Upvest Investment API, it's time to test if it is working as expected.

   Test your Webhook

To make sure that you have set up your Webhook correctly, you can send a GET /webhooks/{id}/test request. This will trigger test Webhook data to be sent to the URL you specified when you registered the Webhook.

The {id} specified is the one included in the payload of the response to a successful POST /webhooks.

The response to the trigger request contains the body, status and headers that we received in response to the POST request to https://tenant.tld/webhooks/users. The following example shows the response to a successful test:

{
    "url": "https://tenant.tld/webhooks/users",
    "response": {
        "status": 200,
        "headers": {
            "Access-Control-Allow-Origin": "*",
            "Content-Length": "19",
            "Content-Type": "application/json; charset=utf-8",
            "Date": "Fri, 15 Oct 2021 16:03:17 GMT",
            "X-Powered-By": "Express"
        },
        "body": "{ \"success\": true }"
    }
}

   You're ready to test Webhooks!

Congratulations! If you've read and understood this content, you should be ready to test your Webhooks.

Next Steps

We suggest you continue by returning to the "Implementing Webhooks" tutorial and reading the "Other Webhook Management functions" section.

Was this page helpful?