ByteChef LogoByteChef
Components

Slack

Slack is a messaging platform for teams to communicate and collaborate.

Categories: Communication, Developer Tools

Type: slack/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
clientIdClient IdSTRINGtrue
clientSecretClient SecretSTRINGtrue

Actions

Send Approval Message

Name: sendApprovalMessage

Sends approval message to a channel.

Properties

NameLabelTypeDescriptionRequired
channelChannelSTRINGChannel, private group, or IM channel to send message to.true
textMessageSTRINGThe text of your message.true

Example JSON Structure

{
  "label" : "Send Approval Message",
  "name" : "sendApprovalMessage",
  "parameters" : {
    "channel" : "",
    "text" : ""
  },
  "type" : "slack/v1/sendApprovalMessage"
}

Output

Type: OBJECT

Properties

NameTypeDescription
okBOOLEAN
Options true, false
Indicates if the message was successfully sent.
channelSTRINGID of the channel the message was sent to.
tsSTRINGTimestamp of the message.
messageOBJECT
Properties {STRING(user), STRING(type), STRING(ts), STRING(text), STRING(team), STRING(subtype)}
The sent message.
warningSTRING
responseMetadataOBJECT
Properties {[STRING](messages)}

Output Example

{
  "ok" : false,
  "channel" : "",
  "ts" : "",
  "message" : {
    "user" : "",
    "type" : "",
    "ts" : "",
    "text" : "",
    "team" : "",
    "subtype" : ""
  },
  "warning" : "",
  "responseMetadata" : {
    "messages" : [ "" ]
  }
}

Send message

Name: sendMessage

Sends a message to a public channel, private channel, or existing direct message conversation.

Properties

NameLabelTypeDescriptionRequired
channelChannel IDSTRINGID of the channel, private group, or IM channel to send message to.true
textMessageSTRINGThe text of your message.true

Example JSON Structure

{
  "label" : "Send message",
  "name" : "sendMessage",
  "parameters" : {
    "channel" : "",
    "text" : ""
  },
  "type" : "slack/v1/sendMessage"
}

Output

Type: OBJECT

Properties

NameTypeDescription
okBOOLEAN
Options true, false
Indicates if the message was successfully sent.
channelSTRINGID of the channel the message was sent to.
tsSTRINGTimestamp of the message.
messageOBJECT
Properties {STRING(user), STRING(type), STRING(ts), STRING(text), STRING(team), STRING(subtype)}
The sent message.
warningSTRING
responseMetadataOBJECT
Properties {[STRING](messages)}

Output Example

{
  "ok" : false,
  "channel" : "",
  "ts" : "",
  "message" : {
    "user" : "",
    "type" : "",
    "ts" : "",
    "text" : "",
    "team" : "",
    "subtype" : ""
  },
  "warning" : "",
  "responseMetadata" : {
    "messages" : [ "" ]
  }
}

Send Direct Message

Name: sendDirectMessage

Sends a direct message to another user in a workspace. If it hasn't already, a direct message conversation will be created.

Properties

NameLabelTypeDescriptionRequired
channelUser IDSTRINGID of the user to send the direct message to.true
textMessageSTRINGThe text of your message.true

Example JSON Structure

{
  "label" : "Send Direct Message",
  "name" : "sendDirectMessage",
  "parameters" : {
    "channel" : "",
    "text" : ""
  },
  "type" : "slack/v1/sendDirectMessage"
}

Output

Type: OBJECT

Properties

NameTypeDescription
okBOOLEAN
Options true, false
Indicates if the message was successfully sent.
channelSTRINGID of the channel the message was sent to.
tsSTRINGTimestamp of the message.
messageOBJECT
Properties {STRING(user), STRING(type), STRING(ts), STRING(text), STRING(team), STRING(subtype)}
The sent message.
warningSTRING
responseMetadataOBJECT
Properties {[STRING](messages)}

Output Example

{
  "ok" : false,
  "channel" : "",
  "ts" : "",
  "message" : {
    "user" : "",
    "type" : "",
    "ts" : "",
    "text" : "",
    "team" : "",
    "subtype" : ""
  },
  "warning" : "",
  "responseMetadata" : {
    "messages" : [ "" ]
  }
}

Triggers

Any Event

Name: anyEvent

Triggers when any user subscribed event happens.

Type: STATIC_WEBHOOK

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

JSON Example

{
  "label" : "Any Event",
  "name" : "anyEvent",
  "type" : "slack/v1/anyEvent"
}

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.


Additional Instructions

Connection Setup

Create OAuth 2.0 App

  1. Navigate to Slack App.
  2. Click on Create New App.
  3. Click on From scratch.
  4. Enter name of your app and select workspace where it will be installed.
  5. Click on Create App.
  6. Click on Basic Information
  7. Click on OAuth & Permissions.
  8. Click on Add New Redirect URL. ByteChef redirect URL: https://127.0.0.1:5173/callback or https://app.bytechef.io/callback.
  9. Click on Add.
  10. Click on Save URLs.
  11. Click on Add an OAuth Scope.
    • channels:read
    • channels:write
    • channels:history
    • chat:write:bot
    • groups:read
    • reactions:read
    • mpim:read
    • users:read
    • incoming-webhook
  12. Under OAuth tokens click on Install to ....

Trigger Setup

Enable Event Subscription

  1. Create workflow with Slack trigger.
  2. Publish the workflow.
  3. Click on Publish.
  4. Go to Project Deployments.
  5. Click on Create Deployment.
  6. Select Slack Project.
  7. Select Version.
  8. Click on Next.
  9. Enable workflow.
  10. Select Connection.
  11. Click on Save.
  12. Enable deployment.
  13. Click on here to expand deployment.
  14. Click this icon to get webhook URL.
  15. Navigate to link and select your app.
  16. Click on Event Subscriptions.
  17. Enable Events.
  18. Click on Enable.
  19. Click on Change.
  20. Enter copied webhook URL to verify it.
  21. Click on Subscribe to bot events.
  22. Click on Add Bot User Event.
  23. You can select any event you want to trigger your workflow.
  24. Click on Save Changes.