Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.
Go to siteThe Pipedream Slack app enables you to build event-driven workflows that interact with the Slack API. Once you authorize the Pipedream app's access to your workspace, you can use Pipedream workflows to perform common Slack actions or write your own code against the Slack API.
The Pipedream Slack app is not a typical app. You don't interact with it directly as a bot, and it doesn't add custom functionality to your workspace out of the box. It makes it easier to automate anything you'd typically use the Slack API for, using Pipedream workflows.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
slack: {
type: "app",
app: "slack",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://slack.com/api/users.profile.get`,
headers: {
Authorization: `Bearer ${this.slack.$auth.oauth_access_token}`,
},
})
},
})
Automated Standup Reports: Trigger a workflow on Pipedream to collect standup updates from team members within a Slack channel at a scheduled time. The workflow compiles updates into a formatted report and posts it to a designated channel or sends it via email using an app like SendGrid.
Customer Support Ticketing: Use Pipedream to monitor a Slack support channel for new messages. On detecting a message, the workflow creates a ticket in a customer support platform like Zendesk or Jira. It can also format and forward critical information back to the Slack channel to keep the team updated.
Real-time CRM Updates: Configure a Pipedream workflow to listen for specific trigger words in sales-related Slack channels. When mentioned, the workflow fetches corresponding data from a CRM tool like Salesforce and posts the latest deal status or customer information in the Slack conversation for quick reference.
The Slack app is the easiest and most convenient option to get started. It installs the official Pipedream bot into your Slack workspace with just a few clicks.
However, if you'd like to use your own bot registered with the Slack API, you can use the Slack Bot app instead.
The Slack Bot requires a bot token to allow your Pipedream workflows to authenticate as your bot. The extra setup steps allow you to list your custom bot on the Slack Marketplace or install the bot on other workspaces as your bot's name instead of as Pipedream.
Emit new event when a new message is posted to one or more channels
Emit new event when a message was posted in a direct message channel
Emit new events on new Slack interactivity events sourced from Block Kit interactive elements, Slash commands, or Shortcuts.
Emit new event when a specific keyword is mentioned in a channel
Send a message to a user, group, private channel or public channel. See the documentation
Configure custom blocks and send to a channel, group, or user. See the documentation.
Send a message as a threaded reply. See postMessage or scheduleMessage docs here
Slack's API will always return JSON, regardless if the request was successfully processed or not.
Each JSON response includes an ok
boolean property indicating whether the action succeeded or failed.
Example of a successful response:
{
"ok": true
}
If the ok
property is false, Slack will also include an error
property with a short machine-readable code that describes the error.
Example of a failure:
{
"ok": false,
"error": "invalid_parameters"
}
Additionally, if the action is successful, there's still a chance of a warning
property in the response. This may contain a comma-separated list of warning codes.
Example of a successful response, but with warnings:
{
"ok": true,
"warnings": "invalid_character_set"
}
Slack uses OAuth authentication. When you connect your Slack account, Pipedream will open a popup window where you can sign into Slack and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Slack API.
Pipedream requests the following authorization scopes when you connect your account:
bookmarks:write
calls:read
calls:write
channels:history
channels:read
channels:write
dnd:read
dnd:write
emoji:read
files:read
groups:history
groups:read
groups:write
im:history
im:read
im:write
links:read
links:write
mpim:history
mpim:read
mpim:write
pins:read
pins:write
reactions:read
reactions:write
reminders:read
reminders:write
remote_files:read
remote_files:share
stars:read
stars:write
team:read
usergroups:read
usergroups:write
users:read
users:read.email
users:write
chat:write:bot
chat:write:user
commands
files:write:user
users.profile:write
users.profile:read
search:read
GET
https://slack.com/oauth/authorize
?
client_id={{oauth.client_id}}
&
state={{oauth.state}}
&
redirect_uri={{oauth.redirect_uri}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://slack.com/api/oauth.access
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=authorization_code
&
code={{oauth.code}}