Slack
Introduction
The purpose of this manual is to detail how to configure and integrate Qflow with Slack to allow interaction between both platforms, allowing to send and respond to Slack messages from Qflow.
Slack has the following actions:
Prerequisites
It is necessary to have a Slack account and a workspace created on the platform. This can be done from here.
Application parameter
To establish the connection, it is necessary to have at least one application parameter (see Application Parameters) that allows establishing communication between Qflow and Slack. This parameter can be created from the service task configuration in Qflow. (see Connector Configuration from a Service Task)
To create a Slack application parameter, the following steps are required as detailed below. To establish a connection, it will only be necessary to configure one of them.
Application parameter using OAuth Authentication Token
This type of application parameter requires the following parameter:
OAuth Authentication Token: It is an authentication token that allows Qflow to connect to Slack as a Bot, simulating being a user and performing operations on behalf of the application.
To obtain it, the following steps must be followed:
Access the Slack apps section. Here, create a new application by selecting Create New App.
Select From scratch to specify that the application is being created from scratch.
Enter the application name and select the workspace to which it will belong, then select Create App. In the example in the image below, it shows that the application is called Qflow and belongs to the Company name workspace.
Select the OAuth & Permissions option in the left menu.
Within OAuth & Permissions, in the Scopes section, select the Add an OAuth Scope option to add a permission to the application.
Add the channels:read and chat:write permissions, which allow reading basic channel information and writing messages in them, respectively.
Within OAuth & Permissions, in the OAuth Tokens for Your Workspace section, select Install to Workspace
Confirm the installation of the application in the workspace.
Once the permissions are confirmed, Slack displays the Bot User OAuth Token, which is the authentication token required to configure the application parameter in Qflow. With this, the necessary steps on the Slack API page are completed.
In Qflow Design, add the Bot User OAuth Token to the OAuth Authentication Token parameter
From the Slack chat, it is necessary to add the application to each Slack channel where you want to allow message sending. You must select the Add apps to this channel option in the desired channel.
Search for the Qflow application and add it to the selected channel. To do this, select Add.
Once the steps are completed, it will be possible to send messages from Qflow to Slack using Slack App.
Application parameter using Webhook
This type of application parameter requires the following parameter:
Webhook Link: A link that represents a Slack communication channel, allowing Qflow to send messages within this channel.
To obtain it, the following steps must be followed:
Perform steps 1 to 3 of the previous section. (see Application parameter using OAuth Authentication Token)
Select the Incoming Webhooks option.
Activate the Incoming Webhooks to be able to use them.
Once the Incoming Webhooks are activated, select the Add New Webhook to Workspace option. Each webhook created will be associated with a specific Slack channel.
Select the channel to associate the webhook with and then select Allow.
Slack will display the Webhook URL of the webhook created for the selected channel, necessary to configure the application parameter in Qflow. With this, the necessary steps on the Slack API page are completed.
In Qflow Design, add the Webhook URL to the Webhook Link parameter
Once the steps are completed, it will be possible to send messages from Qflow to Slack using Webhook.
Actions
The following actions can be performed with Slack:
Send message (Slack App)
This action allows sending a message directly to a Slack channel. The channel name (without the ‘#’) must be provided, followed by the message. If you want to respond to another message, you can also add its identifier. After sending the message, a number is received that identifies the message, allowing to respond to it later.
Input |
Description |
---|---|
Channel name |
Required. The name of the Slack channel to which the message is to be sent. (Without ‘#’ at the beginning) |
Message |
Required. Text of the message to be sent by Slack. |
The identifier of the message to which you want to respond. |
It is obtained when creating a message from Qflow. If you do not want to respond to a message, this parameter can be left blank. |
Output |
Description |
---|---|
Message ID |
The number that identifies the message that has just been sent. This number can be used to respond to this message. |
Send message (Webhook)
This option allows sending messages to a Slack channel, but in a more limited way. The channel to which you send the message is determined by the Webhook used, as each Webhook is associated with a specific channel. It is not possible to respond to messages directly with this option, as the identifier of the message to which you want to respond cannot be specified.
Input |
Description |
---|---|
Message |
Required. Text of the message to be sent by Slack. |