One of the most common use cases for LogicLoop is to have your rule post a message to a Slack channel.
LogicLoop now supports Slack OAuth integration.
In the left navigation bar, click Data Sources and then select Integrations. Here you will be able to connect to Slack by choosing Connect with Service.
Select Slack as your service and choose Grant Access. This will open the Slack OAuth request.
Once you allow LogicLoop access and create your integration, you will see it listed as an active integration.
Now that you have Slack integrated into LogicLoop, add it as an action destination. In the left navigation panel, choose Destinations. Create an action destination of type Slack and choose your integration.
Add an action to a rule by clicking the + Add Action button in the bottom left corner of the Rule source view. Your Slack workspace will now be an available destination.
When configuring your action subscription, you will be able to choose the channel to which you want to post your alerts. You can customize the format of the data you pass through to your Slack alert using our templating guide.
You can customize the format of your Slack notification to include all the information your operator will need to know. You can read more about how to template your notifications here.
Here's an example of Slack notification template:
And here is what it will look like when it triggers an actual Slack message:
Slack has a 3000 character message limit. We recommend adding a link to a dashboard or results to prompt further investigation.
The most common way of interacting with the Slack API is by creating a Slack App Integration. Begin by navigating to the this tutorial on How to quickly get and use a Slack API token. Scroll down to the Create a pre-configured app section and click Create app.
Next, select the workspace that you want to interact with (read from or write to), and click Next. To give the app a recognizable name and description, click Edit Configurations and change the values of
name(you will need this later) and
description. Finally, click Next, then Create.
Under Install your app, click Install to Workspace, and select Allow. At the top of the screen you should see a message telling you to head back to the tutorial. Click the link in the message.
If the Install to Workspace button is disabled, you may need to add permission scopes to your app. On the left menu, under Features, you should see OAuth & Permissions. Click that, scroll down to the Scopes section and add the Bot Scopes that fit your use case.
If you scroll down to the section Using your token, you can find the API token populating a black box (starting with
xoxb). Save that token somewhere safe, you will need it.
We now want to write notifications to Slack. We will send
POSTAPI requests by using the Webhook Builder Action Destination. To do this in LogicLoop, select Destinations from the left side menu, click the New Action Destination button on the top right, and choose Webhook Builder from the menu.
To have your rule ping a Slack channel all you need is your Slack Incoming WebHook URL which you can create here or choose from your existing Slack WebHook URLs here. You can read more about Slack's WebHooks here.
Through Slack's interface, you will be able to choose a channel you want your webhook to post to.
Once you select a channel and click Add Incoming WebHooks integration, you can copy the Slack Webhook URL that is returned.
Once the Slack Action Destination is set up you can go to your rule's action page and add the Slack destination so that every time you rule runs, it will generate a Slack alert if the criteria is fulfilled.