mirror of
https://github.com/mbround18/valheim-docker.git
synced 2021-10-22 21:53:54 +03:00
3.1 KiB
3.1 KiB
Webhook Configuration
Environment Variables
| Variable | Default | Required | Description |
|---|---|---|---|
| WEBHOOK_URL | |
FALSE | Supply this to get information regarding your server's status in a webhook or Discord notification! Click here to learn how to get a webhook url for Discord |
POST Body Example
{
"event_type": {
"name": "Broadcast",
"status": "triggered"
},
"event_message": "Server Status: Broadcast",
"timestamp": "02/22/2021 17:18:04 -08:00"
}
| Key | Description |
|---|---|
event_type.name |
Name of the event |
event_type.status |
Status of the event |
event_message |
A description of the event. |
timestamp |
ISO8601 timestamp |
Considerations
- The expected HTTP codes returned from the webhook should be either 204 or 201 to be considered successful.
- 204 is the default return http code for a webhook as it signifies the request has been processed.
- 201 was included in case you want to stream into an endpoint for creating a resource.
- Example 1, logging actions on the server.
- Example 2, using json-server to debug webhooks.
Developing/Debugging Webhooks
-
Start json-server
docker run --rm -p 3000:3000 vimagick/json-server -H 0.0.0.0 -p 3000 -w db.json -
Run notify against the webhook
cargo run -- notify "Derp Testing another notification" --webhook "http://127.0.0.1:3000/posts"