Slack Web API

Version: 2.1.3

Slack is a cloud-based set of proprietary team collaboration tools and services.

Connect Slack with LogicHub

  1. Navigate to Automations > Integrations.
  2. Search for Slack Web API.
  3. Click Details, then the + icon. Enter the required information in the following fields.
    • Label: Enter a connection name.
    • Reference Values: Define variables here to templatize integration connections and actions. For example, you can use https://www.{{hostname}}.com where, hostname is a variable defined in this input. For more information on how to add data, see 'Add Data' Input Type for Integrations.
    • Verify SSL: Select option to verify connecting server's SSL certificate (Default is Verify SSL Certificate).
    • Remote Agent: Run this integration using the LogicHub Remote Agent.
    • Slack Application Token: Slack Application token for the application used.
  4. After you've entered all the details, click Connect.

Actions for Slack

Post Message - Channel

Post a message on Slack channel.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input NameDescriptionRequired
Message TemplateJinja-templated message string that will be posted on slack. Example: '{{message_col}}'.Required
Channel NameJinja-templated channel name. Example: {{channel_name_column_name}}.Required
Additional FieldsJinja-templated JSON containing the additional fields for the Slack API. If attachments or blocks are included in this field, text will be used as fallback text for notifications only. Example: '{"blocks": [{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]}'Optional

Output

A JSON object containing multiple rows of result:

  • has_error: True/False
  • error: message/null
  • result: Success message string
{
   "result":"Successfully posted message to Slack",
   "error":null,
   "has_error":false
}

Post Message - User

Post a message on Slack directly to a user

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input NameDescriptionRequired
Message TemplateJinja-templated message string that will be posted on slack. Example: {{message_col}}.Required
User NameJinja-templated user name. Example: {{user_name_column_name}}.Required

Output

A JSON object containing multiple rows of result:

  • has_error: True/False
  • error: message/null
  • result: Success message string
{
   "result":"Successfully posted message to Slack",
   "error":null,
   "has_error":false
}

Posting message to private channels

  • Open the channel in slack app.
  • Type / to open the command palette
  • Click on Add apps to this channel
814
  • Search for your app and click on it.
1344
  • Now you will see a successful addition message on the channel.
1344
  • You can now use this channel with this App in the integration.

List User

Lists all users in a Slack team.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input NameDescriptionRequired
LimitNumber containing the limit of users (Default is 10000).Optional

Output

JSON containing the following items:

{
   "is_bot":false,
   "name":"slackbot",
   "tz_offset":-28800,
   "is_admin":false,
   "team_id":"T0JS1",
   "tz":"America/Los_Angeles",
   "color":"757575",
   "is_owner":false,
   "has_error":false,
   "id":"USLACKBOT",
   "profile":{
      "always_active":true,
      "avatar_hash":"sv41d98f0",
      "display_name":"Slackbot",
      "display_name_normalized":"Slackbot",
      "fields":{
         
      },
      "first_name":"slackbot",
      "image_192":"https://a.slack-edge.com/80588/marketing/img/avatars/slackbot/avatar-slackbot.png",
      "image_24":"https://a.slack-edge.com/80588/img/slackbot_24.png",
      "image_32":"https://a.slack-edge.com/80588/img/slackbot_32.png",
      "image_48":"https://a.slack-edge.com/80588/img/slackbot_48.png",
      "image_512":"https://a.slack-edge.com/80588/img/slackbot_512.png",
      "image_72":"https://a.slack-edge.com/80588/img/slackbot_72.png",
      "last_name":"",
      "phone":"",
      "real_name":"Slackbot",
      "real_name_normalized":"Slackbot",
      "skype":"",
      "status_emoji":"",
      "status_emoji_display_info":[
         
      ],
      "status_expiration":0,
      "status_text":"",
      "status_text_canonical":"",
      "team":"T0JSAB8S1",
      "title":""
   },
   "updated":0,
   "error":null,
   "tz_label":"Pacific Standard Time",
   "is_ultra_restricted":false,
   "who_can_share_contact_card":"EVERYONE",
   "real_name":"Slackbot",
   "is_app_user":false,
   "is_restricted":false,
   "is_email_confirmed":false,
   "deleted":false,
   "is_primary_owner":false
}

Release Notes

  • v2.1.3 - Added Additional fields on Post Message - Channel action.
  • v2.1.2 - 1 action added: List User
  • v2.0.0 - Updated architecture to support IO via filesystem
  • v1.0.3 - Added documentation link in the automation library.

© Devo Technology Inc. All Rights Reserved.