Notifications - Webhooks
Your application can be notified about Setting value changes in real-time. ConfigCat enables this by calling a public URL of your system (a so-called Webhook). You can add your Webhook URLs in the Dashboard.
Adding Webhook
- Go to the Webhooks tab.
- Set the Url and the HttpMethod.
- Optionally, you can add additional HTTP headers and a body to the request.
Request body with variables
You can specify a Request body that will be sent as the payload of the HTTP request.
ConfigCat will replace the following variables in the request body:
Variable | The values it gets replaced with |
---|---|
##ConfigName## | The name of the Config your setting belongs to. |
##ConfigId## | ID of the Config. |
##EnvironmentName## | The name of the Environment where the Setting value changed. |
##EnvironmentId## | ID of the Environment. |
##URL## | A direct link to the Config in the ConfigCat Dashboard. |
##ChangeNotes## | The Mandatory notes added to the actual changeset. |
##ChangeDetails## | Details of the change in JSON format including setting name, old, new values and targeting rules. |
The structure of the JSON array injected into the ##ChangeDetails## looks like the following:
Testing your Webhook
- Change some of your settings in the ConfigCat Dashboard.
- Click SAVE & PUBLISH SETTINGS.
- Check if your Webhook was called correctly.
Developer Tip: Running your Webhook on
localhost
? Expose it to the public internet temporarily by using a tool like ngrok. This enables ConfigCat to call your webhook even in your local development environment.
Connecting to Slack
A few steps to set up Slack and get a message when a setting changes:
- Define a Slack Incoming Webhook and copy the Webhook URL.
- Go to the Webhooks tab in the ConfigCat Dashboard.
- Create a Webhook and add your Slack URL.
- Select POST as HTTP method.
- Add a request body like so:
Connecting to Microsoft Teams
A few steps to set up Microsoft Teams and get a message when a setting changes:
- Define an Incoming Webhook connector in Microsoft Teams and copy the Webhook URL.
- Go to the Webhooks tab in the ConfigCat Dashboard.
- Create a Webhook and add your Teams URL.
- Select POST as the HTTP method.
- Add a request body like so:
Sample request body of the Webhook: