L2 Hub
Slack
bot
Send Message

L2 Construct: send_message

slack bot message send

Description

The slack bot L2 sends a message with an optional image to a specified channel in a slack workspace or responds to a slash command/interactive message. The L2 requires either the channel name or a response URL, and the message text. Optionally, you can provide PNG image data as a byte array. The L2 outputs a boolean value indicating whether the message was successfully sent.

L2 Data

  1. Provider: slack
  2. Module: bot
  3. Action: send_message

Example Step

{
  "name": "insert-your-step-name",
  "type": "l2",
  "l2_data": {
    "provider": "slack",
    "module": "bot",
    "action": "send_message"
  }
}
 

Input

Example

{
  "channel_name": "general",
  "response_url": "",
  "text": ["Hello World!"],
  "image_bytes": "iVBORw0KGgo="
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/slack/send-message-input",
  "$ref": "#/$defs/SendMessageInput",
  "$defs": {
    "SendMessageInput": {
      "properties": {
        "channel_name": {
          "type": "string"
        },
        "response_url": {
          "type": "string"
        },
        "text": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "image_bytes": {
          "type": "string",
          "contentEncoding": "base64"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["channel_name", "response_url", "text"]
    }
  }
}
 

Output

Example

{
  "ok": true
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/slack/send-message-output",
  "$ref": "#/$defs/SendMessageOutput",
  "$defs": {
    "SendMessageOutput": {
      "properties": {
        "ok": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["ok"]
    }
  }
}