- Steps to set up Slack API
- Parameter Settings
- Return Value
- As a Bot
- Incoming webhook URL.
- As a User
- User Token.
- As a Bot
3. File(file path) (only when sending as a User)
Steps to set up Slack API
A. Setting up “bot” as sender.
- Login to your Slack account (either with browser or with app).
- Open Slack Bot setup website (https://api.slack.com/).
- Start building the slack bot and put app name and slack workspace.
- App Name shows up as the “sender” when bot is sending messages. You can pick any name you want.
- List of workplaces existing under your login account will show up automatically.
- Select OAuth & Permissions and add bot token scopes.
a. Add required scopes: calls:write, files:write, incoming-webhook
- Select Incoming Webhooks and activate them. Add new webhook to your workspace.
- Click [Copy] and save the Webhook URL information.
B. Setting up “user (you)” as sender.
7. Select OAuth & Permission and add user token scopes.
a. Requires user token scopes: files:write, chat:write
8. Install App to Workspace at the OAuth & Permissions page.
9. Save the OAuth Access Token which starts with xoxp-….
- Sending message from Bot.
2. Sending message from User (you).
- Select [Sting]
- Success: User definable (default is 0).
- Failure: Print error message but the bot will still run.