Send a Message to Slack
Learn how to use fastn connectors.
Introduction
In this guide, we are going to build a flow that is going to send a message to a Slack channel.
Prerequisites
This flow requires a Slack account with access to a workspace.
Create a new flow
- To start off, go to the "Flows" page from the navigation menu on the left and add a new Flow.
- Give your flow a name and create it as an API.
Adding a Slack Connector
-
Drag and drop a connector from the right side menu into the flow.
-
Select fastn connectors and search for the Slack connector.
- Choose the "Send Message" API and click on "Next".
Setting up the Slack Connector
-
This API requires an authToken, a message to send and the channel id to identify where to send the message.
-
We can skip the authToken for now. Instead we will activate the connector in the next step.
-
Add a message text in the message field.
-
To get the channel id, go to the channel in the Slack Desktop App and click on the channel name at the top to see channel details.
-
Scroll down to the bottom of the channel details to see the channel id in the following format "C#######".
-
Add the channel id in the connector and save the connector.
Activating the Slack Connector
-
Go to the "Connectors" page and select fastn connectors.
-
Find the Slack connector and click on the activate button.
- Authorize a connection to the desired Slack account.
-
Return to the flow and re-open the Slack connector.
-
Click on the "Disconnected" label next to the Slack icon.
-
Pick "Default" and click connect.
-
The authToken field will be set automatically and will disappear from the form. Save the connector.
Testing the Flow
- Test your flow using the "Debugger" to see the message pop up in your Slack channel.
Congratulations on setting up your first connector!