Help

Slack command app

Topic Labels: API
1240 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Prof_Thurston
4 - Data Explorer
4 - Data Explorer

Hey,
I’m new to trying to make apps, and I’m stymied by the instructions that came in my inbox from airtable the other day.
I’m rewriting the Glitch example they gave to make it work with airtable.
I placed the “post req handler” OK:
app.post("/slack", function (req, res) {
res.send(‘test response’);
});

Then the instructions say:
And in the “/slack” request handler, verify that the token Slack sends matches our token by adding the following code:
const token = req.body.token;
if (token !== process.env.SLACK_VERIFICATION_TOKEN) {
res.status(403).send(‘Forbidden’);
return;
}
I cannot figure out where exactly that code goes. Glitch gives me an error message no matter where I paste it.
Any help is appreciated.

0 Replies 0