Skip to content

curl, PowerShell and Python

All three examples send the same card in the GGspeak format, with a key: running it again with state set to ok updates the card. The link comes from an environment variable, GGSPEAK_WEBHOOK.

Janela do terminal
curl -fsS -X POST "$GGSPEAK_WEBHOOK" \
-H "Content-Type: application/json" \
-d '{
"key": "nightly-backup",
"card": {
"title": "Nightly backup",
"state": "alert",
"body": "pg_dump failed: no space left on device",
"fields": [{ "name": "Server", "value": "sp-1" }]
}
}'

-f makes curl exit with an error on 4xx and 5xx responses, and -S shows the message even with -s. To see the error body, drop the -f.

To mark it ok when the script finishes fine, send another POST with the same key and "state": "ok" (the card turns resolved). Error codes are in Errors.