Once you've added the above scopes, click "Install App" to install this new Slack app to your workspace. First, make sure you add the following scopes to your bot user: You'll have to add scopes (permissions) to your bot user, and then Next, go through the steps to create a bot user. You set "Development Slack Workspace" to the Slack Workspace you want to use. In order to get a bot user token, you first need to create a new Slack app. Bot user tokens let you post messages as a bot user, with a custom nameĪnd avatar, as opposed to as an existing user. But, for the purposes of this article, I'll be using bot user tokens. Lets you post messages on behalf of a user. There are several types of Slack token, each with its own permissions. ![]() In order to make an API request to Slack, you need a Slack token. However, both and slack areįairly thin wrappers around the Slack API, so, for the purposes of this article, we'll just use axios. ![]() I've also used node-slack in the past, but that module is fairly out of date. There are two npm modules that I recommend for working with the Slack API: the official module and the slack module written primarilyīy Brian LeRoux of WTFJS fame. In this article, I'll explain the basics of how to send a Slack message from Node.js. Slack is the de factoĬommunication platform for many companies, so there's a lot of demand for getting data from Node.js apps to Slack Integrating with the Slack API is becoming an increasingly common task.
0 Comments
Leave a Reply. |