WebHooks are automated messages sent from apps when something happens. They have a message—or payload— and are sent to a unique URL; named WebHook URL. This article will serve to assist with sending WebHook notifications to a Discord server.
Before setting up notifications to Discord, please read over our Alerts article to learn basic concepts and useful tips.
In order to set up WebHook notifications to Discord, you will need:
- A Discord server and channel (within the server) that you want messages to arrive in.
- Admin or super-admin user role within Hudu.
At any time, you can come back to the Hudu admin area >> Alerts >> edit the specific alert to make changes to the alert.
Guides
Enabling Alerts
- Navigate to your Hudu admin area >> Alerts.
- Click ((+ New Alert)).
-
- Give your alert a name.
- Select the expiration type from the choices and complete the required fields (see Alerts for more information).
- Click Configure WebHook and obtain the required WebHook URL from Discord.
- Provide payload delivery information in the WebHook payload field (must be valid JSON format).
- Save the alert by clicking Create Alert.
Obtaining the Discord WebHook URL
- Navigate to your Discord server, and into the channel that you'd like messages to be sent to.
- Click on your Discord server name >> Server Settings.
- Click Integrations >> Create WebHook.
- Edit the newly created WebHook.
- Save your settings.
- Copy the newly generated WebHook URL into Hudu WebHook alert settings exactly.
WebHook Payloads
In order to have a message generated in your Discord, you will need to deliver a payload. A payload is a piece of essential information in a data block that you send to or receive from the server when making API requests. The payload must be sent or received in JSON format.
Here are some examples of WebHook payloads:
Single Expiration
{"content": "Expiration alert: $COMPANY_NAME - $RECORD_NAME. View: $HUDU_URL."}
Expirations
{"content": "There are *$EXPIRATIONS_COUNT* expirations expiring within *$TRIGGER_DAYS* days. View: $EXPIRATIONS_HUDU_URL."}
Websites
{"content": "*$WEBSITE_NAME* appears to be down. View: $WEBSITE_HUDU_URL"}
Testing WebHooks
- Navigate to Hudu admin area >> Alerts and find your created alert from the list.
- Click on Test WebHook.
We are only testing your connection and payload, not your variables; sample variables will be filled in.
Alternative Guides
The guides below will serve to assist with setting up WebHook notifications to alternative common providers.