WardrikSlack.HTTP (wardrik_slack v0.1.0-rc.1)

Copy Markdown

Takes what Slack sends over HTTP.

PathSlack setting
eventsEvent Subscriptions Request URL
actionsInteractivity Request URL

Each request must be signed with the channel's :signing_secret and be under five minutes old. Otherwise it gets 401. Without :signing_secret, every request gets 404.

Slack's url_verification check is answered with its challenge. Everything else is handled in a task. Slack gets 200 once the task is done, or after two seconds, whichever comes first. Slack resends what isn't answered within three seconds. A resent message is asked only once.

Summary

Functions

Answers a request Slack sent the channel.

Returns the x-slack-signature Slack sends with body, signed with secret at Unix time at.

Functions

request(channel, request)

Answers a request Slack sent the channel.

signature(secret, at, body)

@spec signature(String.t(), integer(), String.t()) :: String.t()

Returns the x-slack-signature Slack sends with body, signed with secret at Unix time at.