Based on some events that happen in the back-end of the solution, a message will be sent to relevant slack channels.
- Mongoose
- ExpressJS
- Official Slack API
"@slack/events-api": "2.3.4"
"@slack/web-api": "5.12.0"
"body-parser": "^1.19.0"
"config": "^3.3.2"
"debug": "~2.6.9"
"ejs": "~2.6.1"
"express": "~4.16.1"
"express-gateway": "^1.16.10"
"http-proxy": "^1.18.1"
"mongoose": "^5.10.9"
Install all dep: npm install
-
Install all dependencies
-
Add to package.json:
"type": "module", "scripts": { "start": "node app.js" },
-
Make sure MongoDB server is listening
-
Run
npm start
Address on which the gate takes calls: localhost:8080
- (
This can be modified inside /config/gateway.config.json
)
-
You can send messages/files to all public channels even the app is not part of them. In order to send to private channel, please first add the app to the channel.
/message?channel={slackchannel}&message={message}&attachment={attachment}
- 'slackchannel' must be the name of a channel to send a message to.
- 'message' must be a text - it will automatically URL-encoded.
- 'attachment' is optional and must be A JSON-based array of structured attachments.
- to send a file, send it as multipart/form-data from input/postman
-
/message/{id}?message={message}&attachment={attachment}
- 'id' must be a valid business ID.
- 'message' must be a text - it will automatically URL-encoded.
- 'attachment' is optional and must be A JSON-based array of structured attachments.
- to send a file, send it as multipart/form-data from input/postman
-
/channel?id={id}&channel={slackchannel}
- 'id' must be a valid business ID.
- 'slackchannel' must be the name of a channel to be linked with the business ID.
If you do not have a business ID you can call /channel?channel={slackchannel}
and a new ID will be returned.