Provider Hub
Slack
bot
Send Block Message to Channel

L2 Construct: send_block_message_to_channel

slack bot message send

Description

SendMessageChannel sends a message in a Slack channel.

Input:

  • ChannelId: ID of the channel containing the message
  • Blocks: Array of Slack blocks to replace the message content with

Output:

  • MessageTs: Timestamp of the sent message
  • Error: Error details if the update failed

L2 Data

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

Example Step

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

Input

Example

{
  "channel_id": "C01234567890",
  "blocks": [
    {
      "type": "section"
    }
  ]
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/slack/send-message-channel-input",
  "$ref": "#/$defs/SendMessageChannelInput",
  "$defs": {
    "Accessory": {
      "properties": {
        "type": {
          "type": "string"
        },
        "style": {
          "type": "string"
        },
        "text": {
          "$ref": "#/$defs/TextObject"
        },
        "value": {
          "type": "string"
        },
        "action_id": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["type", "action_id"]
    },
    "Block": {
      "properties": {
        "type": {
          "type": "string"
        },
        "text": {
          "$ref": "#/$defs/TextObject"
        },
        "fields": {
          "items": {
            "$ref": "#/$defs/TextObject"
          },
          "type": "array"
        },
        "accessory": {
          "$ref": "#/$defs/Accessory"
        },
        "elements": {
          "items": {
            "$ref": "#/$defs/Accessory"
          },
          "type": "array"
        },
        "image_url": {
          "type": "string"
        },
        "alt_text": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["type"]
    },
    "SendMessageChannelInput": {
      "properties": {
        "channel_id": {
          "type": "string"
        },
        "blocks": {
          "items": {
            "$ref": "#/$defs/Block"
          },
          "type": "array"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["channel_id", "blocks"]
    },
    "TextObject": {
      "properties": {
        "type": {
          "type": "string"
        },
        "text": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["type", "text"]
    }
  }
}
 

Output

Example

{
  "message_ts": "1234567890.000000",
  "error": {
    "is_error": false
  }
}
 

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pontus.bpa/pkgs/l2/slack/send-message-channel-output",
  "$ref": "#/$defs/SendMessageChannelOutput",
  "$defs": {
    "HandlerError": {
      "properties": {
        "is_error": {
          "type": "boolean"
        },
        "errors": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["is_error"]
    },
    "SendMessageChannelOutput": {
      "properties": {
        "message_ts": {
          "type": "string"
        },
        "error": {
          "$ref": "#/$defs/HandlerError"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": ["message_ts", "error"]
    }
  }
}