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 |
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 ....
Actions
Add Reaction
Name: addReaction
Adds a reaction to a message.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| channel | Channel ID | STRING | ID of the channel, private group, or IM channel where the message is located. | true |
| name | Emoji Name | STRING | Reaction (emoji) name to add. | true |
| timestamp | Timestamp | STRING | Timestamp of the message to add reaction to. | true |
Example JSON Structure
{
"label" : "Add Reaction",
"name" : "addReaction",
"parameters" : {
"channel" : "",
"name" : "",
"timestamp" : ""
},
"type" : "slack/v1/addReaction"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| ok | BOOLEAN Optionstrue, false | Indicates if the reaction was successfully added. |
| warning | STRING | |
| responseMetadata | OBJECT Properties{[STRING](messages)} |
Output Example
{
"ok" : false,
"warning" : "",
"responseMetadata" : {
"messages" : [ "" ]
}
}Find Channel ID and Timestamp
To find the Channel ID, click here
To find the Timestamp, click here
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" : [ "" ]
}
}Find Channel ID
To find the Channel ID, click here
Send Channel Message
Name: sendChannelMessage
Sends a message to a public or private channel.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| channel | Channel ID | STRING | ID of the channel, private group, or IM channel to send message to. | true |
| post_at | Post at | DATE_TIME | Date and time when the message should be sent. | false |
| text | Message | STRING | The text of your message. | true |
Example JSON Structure
{
"label" : "Send Channel Message",
"name" : "sendChannelMessage",
"parameters" : {
"channel" : "",
"post_at" : "2021-01-01T00:00:00",
"text" : ""
},
"type" : "slack/v1/sendChannelMessage"
}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" : [ "" ]
}
}Find Channel ID
To find the Channel ID, click here
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 |
| post_at | Post at | DATE_TIME | Date and time when the message should be sent. | false |
| text | Message | STRING | The text of your message. | true |
Example JSON Structure
{
"label" : "Send Direct Message",
"name" : "sendDirectMessage",
"parameters" : {
"channel" : "",
"post_at" : "2021-01-01T00:00:00",
"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" : [ "" ]
}
}Find Channel ID
To find the Channel ID, click here
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"
}How to set up trigger
To find out how to set up trigger, click here.
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
How to find the Channel ID
Open Slack and then channel (or person you want to send direct message to) you want fo find ID of. When you click on channel name you will see Channel details, and in About tab the lowest written value is the Channel ID.
How to find the Timestamp
There is no other way to find the timestamp of a message than to use Slack API. So the best way to find timestamp is to use output of one of Bytechef's Slack actions.
In the output of the Slack actions you will find ts property, that is timestamp that you need.
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.
How is this guide?
Last updated on