Slack integration

Note: Completing this procedure requires some knowledge on sending API requests using cURL, Postman, or similar tools.

You can integrate Synerise with Slack using webhooks to build a variety of business scenarios. One of them is building a workflow that sends messages to a Slack channel based on metrics, expressions, reports and any other analyses in Synerise

This particular use case reuses a metric (which is a part of an analytical dashboard) that counts the number of customers who signed up for the video call the day before. The message to the channel contains information with the value of the metric.

Screenshot presenting personalized search on a website with no results
Slack integration

Prerequisites


Process overview


  1. Create a metric in Synerise
  2. Prepare an incoming webhook in Slack
  3. Create a workflow in Synerise

Create a metric in Synerise


Configuration of the metric that calculates customers who signed up for a videocall the day before
Configuration of the metric that calculates customers who signed up for a videocall the day before
  1. In Synerise, go to Analytics > Metrics > New metric.
  2. Select the form.submit event.
  3. Select the formType event parameter.
  4. As a logical operator, select Equal(String).
  5. In the text field, enter videocall.
Note: In this use case, the metric is included in the analytical dashboard which is linked in the alert message in Slack.

Prepare an incoming webhook in Slack


Prepare an incoming webhook in Slack according to the documentation.
Result: You receive an endpoint to which you can send the message without any further authorization. You will use this endpoint in the next part of the process.

The structure of the endpoint:

https://hooks.slack.com/services/XXX/XXX/XXX

Tip: Test the endpoint in Postman or a similar tool.

Create a workflow in Synerise


Configuration of the workflow that sends alert messages based on the metric results to the Slack channel
Configuration of the workflow that sends alert messages based on the metric results to the Slack channel
  1. In Synerise, go to Automation > Workflows > New workflow.

  2. Start with the Scheduled Run node. In the configuration of the node:

    1. Set the Run trigger option to all time.
    2. Select the Everyday tab.
    3. Select the time zone.
    4. Select the time when the workflow will be launched.
    5. Confirm by clicking Apply.
    Configuration of the workflow that sends alert messages with the metric results to the Slack channel
    Configuration of the workflow that sends alert messages with the metric results to the Slack channel
  3. Add the Outgoing integration node. In the node configuration:

    1. Enter the name of the webhook (it is available in the action.name parameter of the webhook.response event).

    2. Select the POST method.

    3. Enter the URL of the endpoint you received as a result of preparing the incoming webhook in Slack.

    4. Leave the headers at default values (which is application/json).

    5. Enter the request body. You can define it by yourself, however, you need to include the metric by using Jinjava. Below you can find the example structure of the request:

      {
      	"blocks": [
      		{
      			"type": "section",
      			"text": {
      				"type": "mrkdwn",
      				"text": "Number of people signed in for the videocall: `{% metricsvar metric_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX %}{{ metric_result }}{% endmetricsvar %}`\nNumber of people having the videocall today: `{% metricsvar metric_id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX %}{{ metric_result }}{% endmetricsvar %}`"
      			},
      			"accessory": {
      				"type": "button",
      				"text": {
      					"type": "plain_text",
      					"text": "check dashboard",
      					"emoji": true
      				},
      				"url": "https://app.synerise.com/spa/modules/dashboards/analytics/dashboards/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
      			}
      		}
      	]
      }
              
    Configuration of Outgoing integration
    Configuration of Outgoing integration
    1. Confirm by clicking Apply.
  4. Add the End node.

  5. Launch the workflow by clicking Save&Run.
    Result: A message is sent to the Slack channel.

    Message on the Slack channel
    Message on the Slack channel

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker