Skip to main content

Get Slack deliveries into Webhook Trap

Slack checks a new Request URL with a url_verification challenge, and only your own handler can answer it. A capture URL answers {"received":true}, so Slack won’t save it as the Request URL. Two ways in:
  • Relay: in your handler, after it answers Slack, forward the raw request (body and headers, unchanged) to your capture URL.
  • Fixtures: write deliveries you logged as fixture files and run them with webhooktrap test.
Webhook Trap recognises a Slack delivery by its X-Slack-Signature and X-Slack-Request-Timestamp headers. It takes the event type from event.type and the event id from event_id, and groups events by channel (event.channel).

Configure the agent

webhooktrap.yml
If you leave out secret, the agent looks for SLACK_SIGNING_SECRET, the name in the Slack pack. It is the app’s Signing Secret (Basic Information › App Credentials), not a bot token.
Your signing secret stays on your machine. webhooktrap.yml holds only the name of the environment variable (secret: env:NAME). The agent reads the value when it signs a delivery, strips every known secret variable from the environment of probe and reset commands, and refuses to write or upload a run document that contains the secret. The server learns the variable’s name, never its value.
Slack signs v0:<timestamp>:<body> with HMAC-SHA256 and sends v0=<hex> in X-Slack-Signature. Slack’s docs ask you to reject a timestamp more than five minutes from your clock, so the pack’s tolerance is 300 s.

What the scenarios do for Slack

The 3 s budget comes from Slack’s docs: answer with a 2xx within three seconds. A budget: above it in webhooktrap.yml is refused as a configuration error.

Sources