Tonic allows you to set up webhooks to fire HTTP POST requests after certain events during a database generation, enabling Tonic to integrate more seamlessly into your workflow. These requests can pass information about the run and trigger actions in other systems.
Webhooks, like post-job scripts, are created and configured on the Post-Job Actions page. To create a webhook, click the "Create Webhook" button outlined below.
Clicking this button will open a dialog that will allow you to set up your webhook request. On the "Settings & Headers" tab, you will be able to name your webhook, provide the url for the request, select which events you would like to trigger this webook call, and provide custom request headers. A webhook configuration may be triggered by one or multiple events.
On the "Message Body" tab, you can customize the body of the request by providing keys and values, which will be sent as a JSON payload. You have access to a set of variables that may be sent about the job generation including the job's id, the job's status, and the id for the workspace associated with the job. When the webhook request is sent, the variables will be replaced with the actual values specific to the triggering event.
On the preview tab, you can look at the JSON body of the request, with the variables replaced by sample values. Here, you have the ability to copy the JSON to your clipboard in case you want to test the webhook call somewhere else, like Postman. Tonic provides the ability to make a test request, which will include the configured headers and body (variables replaced with sample values), directly from Tonic. Press the "Test Webhook" button in the bottom left at any time to test a webhook configuration.
You can view all of your webhooks, ordered by the most recent time each was edited, in the "Webhooks" section on the Post-Job Actions page. Note that you can choose to disable any webhook if you do not want it to be triggered by a database generation. Toggle the switch next to the webhook's name to disable it (you will see the webhook appear grayed out). Note that you may re-enable it at any time.
If you want to delete a webhook configuration, click the trash can icon on the right; you will need to confirm deletion of that specific webhook prior to permanently deleting it. To edit a specific configuration, click on the pencil icon, which will open the same dialog used to create the webhook.