Basic Slack Api SDK
npm install slack-sdk







Basic Slack Api SDK using User Session Token
```
npm i --save slack-sdk
`javascript
const slack = require('slack-sdk')('workspace-name', 'user-session-token', {/ options /});
slack.channel.message('channel-name', 'message');
`
Cache duration in seconds. Optional, defaults to 60.
Maximum number of entries in cache at any given time. Optional, defaults to 100.
1) Go to https://YOURWORKSPACE.slack.com/home in Chrome
2) Right click → Inspect
3) Select the network tab
4) Reload the page
5) Type in api in the search
6) Click rtm.start and then headers
7) Scroll down until you find the token. It starts with xoxs-
8) Copy it!
Send message to self.
Share files to self.
Get meta information about channel channel
Send message to channel channel.
Set topic of channel channel
Set purpose of channel channel
Share files to a channel channel.
Obtain details for workspace. Should usually be cached as it is easy to run into rate limits.
Upload file. Title and filename default to basename of filepath. Returns file id.
Send request to slack endpoint endpoint with parameters params.
E.g. call("rtm.start", {}, true)` to obtain information about current user. Use cache if information was already obtained before.
Cache operates by matching the exact outgoing request signature.
Cached and non-cached requests operate separately. So making a non cached request does never alter the cache.