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
Name | Label | Type | Description | Required |
---|---|---|---|---|
clientId | Client Id | STRING | true | |
clientSecret | Client Secret | STRING | true |
Actions
Send Approval Message
Name: sendApprovalMessage
Sends approval message to a channel.
Properties
Name | Label | Type | Description | Required |
---|---|---|---|---|
channel | Channel | STRING | Channel, private group, or IM channel to send message to. | true |
text | Message | STRING | The 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
Name | Type | Description |
---|---|---|
ok | BOOLEAN Optionstrue, false | Indicates if the message was successfully sent. |
channel | STRING | ID of the channel the message was sent to. |
ts | STRING | Timestamp of the message. |
message | OBJECT Properties{STRING(user), STRING(type), STRING(ts), STRING(text), STRING(team), STRING(subtype)} | The sent message. |
warning | STRING | |
responseMetadata | OBJECT 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
Name | Label | Type | Description | Required |
---|---|---|---|---|
channel | Channel ID | STRING | ID of the channel, private group, or IM channel to send message to. | true |
text | Message | STRING | The text of your message. | true |
Example JSON Structure
{
"label" : "Send message",
"name" : "sendMessage",
"parameters" : {
"channel" : "",
"text" : ""
},
"type" : "slack/v1/sendMessage"
}
Output
Type: OBJECT
Properties
Name | Type | Description |
---|---|---|
ok | BOOLEAN Optionstrue, false | Indicates if the message was successfully sent. |
channel | STRING | ID of the channel the message was sent to. |
ts | STRING | Timestamp of the message. |
message | OBJECT Properties{STRING(user), STRING(type), STRING(ts), STRING(text), STRING(team), STRING(subtype)} | The sent message. |
warning | STRING | |
responseMetadata | OBJECT 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
Name | Label | Type | Description | Required |
---|---|---|---|---|
channel | User ID | STRING | ID of the user to send the direct message to. | true |
text | Message | STRING | The 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
Name | Type | Description |
---|---|---|
ok | BOOLEAN Optionstrue, false | Indicates if the message was successfully sent. |
channel | STRING | ID of the channel the message was sent to. |
ts | STRING | Timestamp of the message. |
message | OBJECT Properties{STRING(user), STRING(type), STRING(ts), STRING(text), STRING(team), STRING(subtype)} | The sent message. |
warning | STRING | |
responseMetadata | OBJECT 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
- Navigate to Slack App.
- Click on Create New App.
- Click on From scratch.
- Enter name of your app and select workspace where it will be installed.
- Click on Create App.
- Click on Basic Information
- Click on OAuth & Permissions.
- Click on Add New Redirect URL. ByteChef redirect URL: https://127.0.0.1:5173/callback or https://app.bytechef.io/callback.
- Click on Add.
- Click on Save URLs.
- 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
- Under OAuth tokens click on Install to ....
Trigger Setup
Enable Event Subscription
- Create workflow with Slack trigger.
- Publish the workflow.
- Click on Publish.
- Go to Project Deployments.
- Click on Create Deployment.
- Select Slack Project.
- Select Version.
- Click on Next.
- Enable workflow.
- Select Connection.
- Click on Save.
- Enable deployment.
- Click on here to expand deployment.
- Click this icon to get webhook URL.
- Navigate to link and select your app.
- Click on Event Subscriptions.
- Enable Events.
- Click on Enable.
- Click on Change.
- Enter copied webhook URL to verify it.
- Click on Subscribe to bot events.
- Click on Add Bot User Event.
- You can select any event you want to trigger your workflow.
- Click on Save Changes.