📊Slack

How to connect Dapta and Slack

Send Slack Message

This is a tutorial to connect via Slack API to send Slack messages from the Flow Studio. In order to do this you need to be a Slack Workspace administrator so that you can edit the API integrations.

Your first step is to go to https://api.slack.com/apps and create a new App from scratch

This is going to create the new app where you can set up all of the visual components of the integration to make sure the name that will appear on each message and the image are to your liking.

It’s important to note that the first step you need to take is to add the Permissions and Scopes so that you can actually send messages via the API.

To send messages the most important Scope is the “chat:write”, but you can add any scopes that you see fit.

Once you’ve set your Scopes, you can go ahead and proceed to install the app to your workspace

This will generate your “Bot User OAuth Token”, which is you key to sending messages from the Slack API

Once you have this token, you have to invite the application into the channel you want messages to be sent. To to this, go to the channel and type “/invite” and go to the option to add applications to channel

Once this is set, you need to get the channel ID. TO get this ID you need to sign in to Slack online, navigate to the channel and get the URL. This ID is located in the URL between the end of the URL and the last slash. In this case, the ID would be C08PU07PY5R

Now we’re all set to send the message via the API from Dapta.

Go to the Flow Studio section and create a new flow. The proceed to add an API node

In the API make sure to add this URL and set it as a Post method: https://slack.com/api/chat.postMessage. Now go to the Headers tab and add a Header for “Authorization”, and type “Bearer” and the token value gotten from the Slack API page

Now go to the Body tab, paste your channel ID and set the message that you want to send

Now you’re all set! You can also change the icon and name of the app from the Basic Information in case you want your integration to have a more dynamic look

Last updated