zzamp
zzamp

Reputation: 31

Responding to Slack Events API

I am trying to build a slackbot which communicates with Cloud functions. Where there is an event, slack will send out a POST request and I will do some processing and use the incoming webhook to write to slack channel. However I saw a documentation, which says if you don't respond, they will try again. Hence it seems to be continuously writing because I did not respond. There also seems to be no clear documentation on how I should respond. Is there a clearer documentation? Please advice. Thank you.

enter image description here

https://api.slack.com/events-api

Upvotes: 0

Views: 907

Answers (1)

Elias
Elias

Reputation: 1560

It's very clearly described what you need to respond with:

Your app should respond to the event request with an HTTP 2xx within three seconds

HTTP 2XX is an indication of an HTTP status code, ranging from 200 to 299 (not all of them exist per the standard). Depending on which framework you are using, you can probably set an HTTP status code in the response of a web request. Body of your response doesn't seem to matter, as long as it is an HTTP 2XX status code.

List of HTTP 2XX status codes

Upvotes: 2

Related Questions