Slack Component
Send messages to Slack channels and users
Component key: slack
Description
The Slack component allows you to post messages to a Slack channel.
API Documentation
This component was built using the following API References:
Processing Slack events in real-time
Slack requires that you provide only one webhook URL for your app, and Slack will send all customers' events to that URL. If you would like to detect and process changes to your customers' Slack accounts in real-time, see the Single-Endpoint Webhook Integrations guide on handling webhook requests from apps that require you to specify a single webhook endpoint.
Connections
Slack OAuth 2.0
The vast majority of actions in this component use OAuth 2.0 for authentication. To create a Slack OAuth 2.0 connection, first create and configure a Slack App by visiting the Slack Developer App Portal:
- Click Create New App
- Choose to create the app From scratch
- Give your app a name and select your workspace. We'll configure it to be multi-workspace capable in a moment
- Select OAuth & Permissions from the sidebar
- Under Redirect URLs, add
https://oauth2.prismatic.io/callback
for US based integrations. - For integrations outside the US refer to this guide to find your region’s Callback URL.
- At the bottom, add some User Token Scopes if you plan for this integration to send messages on behalf of customers, or Bot Token Scopes if a Slack "bot" will send the messages.
What scopes you need is dependent on what types of things your Slack integration will need to do (create channels, send messages, etc).
If you just need to send messages to a channel as a bot, add these scopes:
chat:write chat:write.public
. If you want to send messages as a user, see the section below.
- Under Redirect URLs, add
- Next, select Distribute App under Manage Distribution. Confirm that you have "removed hard coded information" and select Activate Public Distribution. Your app needs to be publicly distributed for your customers to install it in their Slack workspaces.
- Finally, open Basic Information. Take note of the Client ID, Client Secret and Signing Secret.
Now it's time to configure your integration to use your Slack OAuth 2.0 app. Add a Slack step to your integration - that'll create a connection config variable for you. Open up that connection config variable.
Enter Client ID, Signing Secret and Client Secret that you noted before.
The Scopes that you need to enter depends on what Slack actions your integration includes:
- If you're just sending messages to a channel, you can enter the scopes
chat:write chat:write.public
and that will assign you a bot token that can write messages to public channels. See below for information on sending messages to private channels. - Conversation and channel-related actions require
admin.conversations:write
.
Enter scopes with spaces in between them (e.g. chat:write users:read users:read.email
).
A list of all Slack OAuth scopes and what each does are available in their docs.
Sending messages to private channels
The chat:write.public
scope allows your bot to send messages to public channels.
If you would like to send messages to private channels, or would like to be more selective about what channels your bot can send messages to, your customer will need to invite the bot to specific channels.
If a bot does not have chat:write.public
or tries to write to a private channel it's not a part of, you'll receive a not_in_channel
error from Slack when you attempt to send a message to that channel.
Sending messages as a user
Slack applications typically send messages as bot users.
If you would instead like to send messages as a user, edit the Auth URL
add chat:write
to a user_scope query parameter on the Authorization URL to get a User token. To manage channels, add the channels:write
scope.
Your Auth URL
, then, will look something like this: https://slack.com/oauth/v2/authorize?user_scope=chat:write
Dynamically changing your bot's name
Your bot's username and icon are things you set when you create your Slack app.
If you would like to override your bot's username within your integration, you will need to request the chat:write.customize
scope in addition to chat:write
.
GovSlack
Slack offrs GovSlack for government organizations that require compliance with FIPS 140-2, FedRAMP, ITAR, etc.
To use the Slack component with GovSlack, change the beginning of OAuth auth URL, token URL, and revoke URL from https://slack.com
to https://slack-gov.com
.
The component will automatically point API requests towards the Slack Gov API endpoint.
Input | Default | Notes | Example |
---|---|---|---|
Authorize URL string / Required authorizeUrl | https://slack.com/oauth/v2/authorize | The OAuth 2.0 Authorization URL for Slack. If you want to request access to the API on behalf of a User, append a 'user_scope' query parameter to the end of the Authorize URL: https://slack.com/oauth/v2/authorize?user_scope=chat:write,channels:read,groups:read,im:read,mpim:read | |
Client ID string / Required clientId | |||
Client Secret password / Required clientSecret | |||
Is User boolean / Required isUser | false | Flip the flag to true if you want to access the API as a User. If flipped you must also provide a 'user_scope' query parameter to the end of the Authorize URL. Leaving the flag false will grant you a Bot token instead. | |
Revoke URL string / Required revokeUrl | https://slack.com/api/auth.revoke | The OAuth 2.0 Revocation URL for Slack | |
Scopes (Bot) string scopes | chat:write chat:write.public chat:write.customize channels:read groups:read im:read mpim:read | A space-delimited set of one or more scopes to get the Bot token. If you want to access the API as a User, you must append a 'user_scope' query parameter to the end of the Authorize URL and set the 'Is User' flag to true. | chat:write chat:write.public users:read channels:read files:read files:write channels:manage channels:history groups:history mpim:history im:history |
Signing Secret password / Required signingSecret | |||
Token URL string / Required tokenUrl | https://slack.com/api/oauth.v2.access | The OAuth 2.0 Token URL for Slack |
Webhook URL
The Slack Message from Webhook and the Slack Block Message from Webhook actions are the only Slack actions that do not authenticate with OAuth. Instead, it uses Slack Incoming Webhooks. For your customers to use this authorization method, they will need to create their own Slack apps and incoming webhooks.
To generate a Slack incoming webhook URL:
- Navigate to https://api.slack.com/apps
- Click Create New App, adding an app to your workspace.
- Under Add features and functionality select Incoming Webhooks
- Activate Incoming Webhooks and then Add New Webhook to Workspace
- Take note of the Webhook URL. It should be of the form
https://hooks.slack.com/services/foo/bar/baz
Input | Notes | Example |
---|---|---|
Webhook URL string / Required webhookUrl | The Slack webhook URL. Instructions for generating a Slack webhook are available on the Slack component docs page. | https://hooks.slack.com/services/TXXXX/BXXXXX/XXXXXXX |
Triggers
App Webhook
Trigger for handling slash command and modal webhooks from Slack | key: slashCommandWebhook
Input | Default | Notes |
---|---|---|
Content Type string / Required contentType | text/plain | |
Response Body code responseBody |
Events API Webhook
Receive and validate webhook requests from Slack's Events API for webhooks you configure. | key: webhook
Input | Notes |
---|---|
Connection connection / Required slackConnection | The connection to use |
You can configure Slack to send events to a Prismatic integration. This webhook trigger uses your Slack app's signing secret to verify that messages come from Slack. If a challenge request is received, this trigger responds with the proper challenge response and this trigger follows the "URL Verify" branch. For other notifications, like a "channel create" event occurred, this trigger follows the "Notification" path.
If you would like to invoke a flow that uses a Slack webhook trigger from an app other than Slack, you can send an additional header, prismatic-bypass-challenge: true
with your request, to bypass Slack message verification.
When that header is present your integration will follow the "Management" branch.
Example Payload for Events API Webhook
{
"branch": "Notification",
"payload": {
"headers": {
"accept": "*/*",
"Content-Type": "application/json",
"User-Agent": "Slackbot 1.0 (+https://api.slack.com/robots)",
"Host": "hooks.example.prismatic.io"
},
"body": {
"data": {}
},
"rawBody": {
"data": {
"type": "Buffer",
"data": [
69,
120,
97,
109,
112,
108,
101
]
}
},
"queryParameters": {},
"webhookUrls": {
"Flow 1": "https://hooks.example.prismatic.io/trigger/EXAMPLEGbG93Q29uZmlnOmRlNmNmNDMyLTliNWMtN0005NDMxLTRmYzA4ZjViODgxOA=="
},
"webhookApiKeys": {
"Flow 1": [
"abc-123"
]
},
"customer": {
"externalId": "customer-example-external-id",
"name": "John Doe"
}
},
"response": {
"statusCode": 200,
"contentType": "text/plain",
"body": "3eZbrw1aBm2rZgRNFdxV2595E9CY3gmdALWMmHkvFXO7tYXAYM8P"
}
}
Data Sources
Select Channel
Select a Slack channel from a dropdown menu (up to 10,000 channels). To select Private Channels, you must access the API as a User and use the 'user_scope' configuration. | key: selectChannels | type: picklist
Input | Default | Notes |
---|---|---|
Connection connection / Required connection | The connection to use | |
Include IM channels? boolean includeImChannels | false | |
Include multi-party IM (mpim) channels? boolean includeMultiPartyImchannels | false | |
Include private channels? boolean includePrivateChannels | false | |
Include public channels? boolean includePublicChannels | true | |
Show channel ID in dropdown? boolean showIdInDropdown | false | Show '#my-channel' vs. '#my-channel (ID: C123456)' |
Example Payload for Select Channel
{
"result": [
{
"key": "C123456",
"label": "#general (ID: C123456)"
},
{
"key": "C000000",
"label": "#other-channel (ID: C000000)"
},
{
"key": "C555555",
"label": "#random (ID: C555555)"
}
]
}
Select User
Select a User from a dropdown menu (up to 10,000 users) | key: selectUsers | type: picklist
Input | Default | Notes |
---|---|---|
Connection connection / Required connection | The connection to use | |
Show user ID in dropdown? boolean showIdInDropdown | false | Show '#user-id' vs. '#user-id (ID: C123456)' |
Example Payload for Select User
{
"result": [
{
"key": "C123456",
"label": "Jhon (ID: C123456)"
},
{
"key": "C000000",
"label": "Doe (ID: C000000)"
}
]
}
Actions
Archive Conversation
Archive an existing conversation | key: archiveConversation
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. |
Example Payload for Archive Conversation
{
"data": {
"ok": true
}
}
Close Conversation
Close an existing conversation | key: closeConversation
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Conversation Name string / Required conversationName | The name of the Slack conversation. | Book Club | |
Debug boolean debug | When true, the payload will be logged. |
Example Payload for Close Conversation
{
"data": {
"ok": true,
"no_op": true,
"already_closed": true
}
}
Conversation Exists
Returns true if the conversation already exists | key: conversationExists
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. |
Example Payload for Conversation Exists
{
"data": true
}
Create Conversation
Create a new conversation | key: createConversation
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Conversation Name string / Required conversationName | The name of the Slack conversation. | Book Club | |
Debug boolean debug | When true, the payload will be logged. | ||
Is Private boolean / Required isPrivate | false | This flag will determine if the Slack conversation is private. | |
Team Id string teamId | The Id of the Slack team. | 84350944036 |
Example Payload for Create Conversation
{
"data": {
"ok": true,
"channels": [
{
"id": "COZ7e3d",
"name": "example channel",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_private": false,
"is_archived": false,
"created": 6426934241,
"creator": "example",
"unlinked": 0,
"name_normalized": "example channel",
"shared_team_ids": [
"TW2oP78"
],
"purpose": {
"value": "This channel was created for an example response."
}
}
]
}
}
Delete a pending scheduled message
Delete the content and metadata of a pending scheduled message from a queue | key: deletePendingMessage
Input | Default | Notes | Example |
---|---|---|---|
Channel ID string / Required channelId | The static ID of the Slack channel. | C02MS7HV6KB | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Message Id string / Required messageId | A unique identifier of a message or thread to reply to (thread_ts) | 84350944036 |
Example Payload for Delete a pending scheduled message
{
"data": {
"ok": true
}
}
Delete message
Delete the content and metadata of an existing message | key: deleteMessage
Input | Default | Notes | Example |
---|---|---|---|
Channel ID string / Required channelId | The static ID of the Slack channel. | C02MS7HV6KB | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Message Id string / Required messageId | A unique identifier of a message or thread to reply to (thread_ts) | 84350944036 |
Example Payload for Delete message
{
"data": {
"ok": true,
"channel": "C123ABC456",
"ts": "1401383885.000061"
}
}
Get Conversation History
Get the history of a conversation | key: getConversationsHistory
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Cursor string cursor | Provide a cursor pointing to the page you would like to access | 3 | |
Debug boolean debug | When true, the payload will be logged. | ||
Include All Metadata boolean includeAllMetadata | |||
Inclusive boolean inclusive | Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified | ||
Latest string latest | Only messages before this Unix timestamp will be included in results. Default is current time. | ||
Limit string limit | Provide a numerical limit to the amount of results returned. | 80 | |
Oldest string oldest | Only messages after this Unix timestamp will be included in results |
Example Payload for Get Conversation History
{
"data": {
"ok": true,
"messages": [
{
"client_msg_id": "123123-123123-123123",
"type": "message",
"text": "hello world",
"user": "U01QFFSE2QK",
"ts": "166149417.178179",
"team": "TH0GJM0M8"
}
]
}
}
Get User By Email
Get a user's information by email | key: getUser
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Email string / Required email | Provide a string value for the email address of the user. | someone@example.com |
Example Payload for Get User By Email
{
"data": {
"ok": true,
"user": {
"id": "example",
"color": "example",
"deleted": false,
"real_name": "Example User",
"name": "Example User",
"tz": "America/Chicago",
"profile": {
"title": "example",
"phone": "example",
"skype": "example",
"real_name": "Slackbots",
"real_name_normalized": "example",
"first_name": "example",
"email": "example",
"team": "example",
"display_name": "example"
}
}
}
}
Get User By ID
Get a user's information by ID | key: getUserById
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
User Id string / Required user | Provide a string value for the unique identifier of the user you want to send the message to. | 84350944036 |
Example Payload for Get User By ID
{
"data": {
"ok": true,
"user": {
"id": "example",
"color": "example",
"deleted": false,
"real_name": "Example User",
"name": "Example User",
"tz": "America/Chicago",
"profile": {
"title": "example",
"phone": "example",
"skype": "example",
"real_name": "Slackbots",
"real_name_normalized": "example",
"first_name": "example",
"email": "example",
"team": "example",
"display_name": "example"
}
}
}
}
Invite User To Conversation
Invite a user to an existing conversation | key: inviteUserToConversation
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
User Id string / Required userId | Provide a string value for the unique identifier of the user you want to send the message to. | 84350944036 |
Example Payload for Invite User To Conversation
{
"data": {
"ok": true,
"channel": {
"id": "C012AB3CD",
"name": "general",
"is_channel": true,
"is_group": false,
"is_im": false,
"created": 1449252889,
"creator": "W012A3BCD",
"is_archived": false,
"is_general": true,
"unlinked": 0,
"name_normalized": "general",
"is_read_only": false,
"is_shared": false,
"is_ext_shared": false,
"is_org_shared": false,
"pending_shared": [],
"is_pending_ext_shared": false,
"is_member": true,
"is_private": false,
"is_mpim": false,
"last_read": "1502126650.228446",
"topic": {
"value": "For public discussion of generalities",
"creator": "W012A3BCD",
"last_set": 1449709364
},
"purpose": {
"value": "This part of the workspace is for fun. Make fun here.",
"creator": "W012A3BCD",
"last_set": 1449709364
},
"previous_names": [
"specifics",
"abstractions",
"etc"
]
}
}
}
Leave Conversations
Leave an existing conversation | key: leaveConversation
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. |
Example Payload for Leave Conversations
{
"data": {
"ok": true,
"not_in_channel": true
}
}
List Conversation Members
List all members of a conversation | key: listConversationMembers
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Cursor string cursor | Provide a cursor pointing to the page you would like to access | 3 | |
Debug boolean debug | When true, the payload will be logged. | ||
Limit string limit | Provide a numerical limit to the amount of results returned. | 80 |
Example Payload for List Conversation Members
{
"data": {
"ok": true,
"members": [
"U023BECGF",
"U061F7AUR",
"W012A3CDE"
],
"response_metadata": {
"next_cursor": "e3VzZXJfaWQ6IFcxMjM0NTY3fQ=="
}
}
}
List Conversations
List all conversations | key: listConversations
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Cursor string cursor | Provide a cursor pointing to the page you would like to access | 3 | |
Debug boolean debug | When true, the payload will be logged. | ||
Exclude Archived boolean excludeArchived | false | This flag will determine if archived results will be excluded from the result set. | |
Include IM channels? boolean includeImChannels | false | ||
Include multi-party IM (mpim) channels? boolean includeMultiPartyImchannels | false | ||
Include private channels? boolean includePrivateChannels | false | ||
Include public channels? boolean includePublicChannels | true | ||
Limit string limit | Provide a numerical limit to the amount of results returned. | 80 | |
Team Id string teamId | The Id of the Slack team. | 84350944036 |
Example Payload for List Conversations
{
"data": {
"ok": true,
"channels": [
{
"id": "COZ7e3d",
"name": "example channel",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_private": false,
"is_archived": false,
"created": 6426934241,
"creator": "example",
"unlinked": 0,
"name_normalized": "example channel",
"shared_team_ids": [
"TW2oP78"
],
"purpose": {
"value": "This channel was created for an example response."
}
}
]
}
}
List Files
List all available files | key: listFiles
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Cursor string cursor | Provide a cursor pointing to the page you would like to access | 3 | |
Debug boolean debug | When true, the payload will be logged. |
Example Payload for List Files
{
"data": {
"ok": true,
"files": [
{
"id": "F0S43P1CZ",
"created": 1531763254,
"timestamp": 1531763254,
"name": "billair.gif",
"title": "billair.gif",
"mimetype": "image/gif",
"filetype": "gif",
"pretty_type": "GIF",
"user": "U061F7AUR",
"editable": false,
"size": 144538,
"mode": "hosted",
"is_external": false,
"external_type": "",
"is_public": true,
"public_url_shared": false,
"display_as_bot": false,
"username": "",
"url_private": "https://.../billair.gif",
"url_private_download": "https://.../billair.gif",
"thumb_64": "https://.../billair_64.png",
"thumb_80": "https://.../billair_80.png",
"thumb_360": "https://.../billair_360.png",
"thumb_360_w": 176,
"thumb_360_h": 226,
"thumb_160": "https://.../billair_=_160.png",
"thumb_360_gif": "https://.../billair_360.gif",
"image_exif_rotation": 1,
"original_w": 176,
"original_h": 226,
"deanimate_gif": "https://.../billair_deanimate_gif.png",
"pjpeg": "https://.../billair_pjpeg.jpg",
"permalink": "https://.../billair.gif",
"permalink_public": "https://.../...",
"channels": [
"C0T8SE4AU"
],
"groups": [],
"ims": [],
"comments_count": 0
},
{
"id": "F0S43P1CZ",
"created": 1531763254,
"timestamp": 1531763254,
"name": "billair.gif",
"title": "billair.gif",
"mimetype": "image/gif",
"filetype": "gif",
"pretty_type": "GIF",
"user": "U061F7AUR",
"editable": false,
"size": 144538,
"mode": "hosted",
"is_external": false,
"external_type": "",
"is_public": true,
"public_url_shared": false,
"display_as_bot": false,
"username": "",
"url_private": "https://.../billair.gif",
"url_private_download": "https://.../billair.gif",
"thumb_64": "https://.../billair_64.png",
"thumb_80": "https://.../billair_80.png",
"thumb_360": "https://.../billair_360.png",
"thumb_360_w": 176,
"thumb_360_h": 226,
"thumb_160": "https://.../billair_=_160.png",
"thumb_360_gif": "https://.../billair_360.gif",
"image_exif_rotation": 1,
"original_w": 176,
"original_h": 226,
"deanimate_gif": "https://.../billair_deanimate_gif.png",
"pjpeg": "https://.../billair_pjpeg.jpg",
"permalink": "https://.../billair.gif",
"permalink_public": "https://.../...",
"channels": [
"C0T8SE4AU"
],
"groups": [],
"ims": [],
"comments_count": 0
}
],
"paging": {
"count": 100,
"total": 2,
"page": 1,
"pages": 1
}
}
}
List Scheduled Messages
List all scheduled messages | key: listScheduledMessages
Input | Notes |
---|---|
Connection connection / Required connection | The connection to use |
Example Payload for List Scheduled Messages
{
"data": {
"ok": true,
"scheduled_messages": [
{
"id": 1298393284,
"channel_id": "C1H9RESGL",
"post_at": 1551991428,
"date_created": 1551891734,
"text": "Here's a message for you in the future"
}
],
"response_metadata": {
"next_cursor": ""
}
}
}
List Users
List Users | key: listUsers
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Cursor string cursor | Provide a cursor pointing to the page you would like to access | 3 | |
Debug boolean debug | When true, the payload will be logged. | ||
Limit string limit | Provide a numerical limit to the amount of results returned. | 80 | |
Team Id string teamId | The Id of the Slack team. | 84350944036 |
Example Payload for List Users
{
"data": {
"ok": true,
"members": [
{
"id": "Exmple",
"team_id": "34700c09vs0zx",
"name": "Example",
"deleted": false,
"color": "37373",
"profile": {
"title": "example",
"phone": "example",
"skype": "example",
"real_name": "Slackbots",
"real_name_normalized": "example",
"always_active": true,
"first_name": "example",
"email": "example",
"team": "example",
"display_name": "example"
}
}
],
"response_metadata": {
"next_cursor": "",
"scopes": [
"admin",
"idetify",
"channels:read"
]
}
}
}
List Users Conversations
List Users Conversations | key: listUsersConversations
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Cursor string cursor | Provide a cursor pointing to the page you would like to access | 3 | |
Debug boolean debug | When true, the payload will be logged. | ||
Limit string limit | Provide a numerical limit to the amount of results returned. | 80 | |
Team Id string teamId | The Id of the Slack team. | 84350944036 | |
User Id string / Required userId | Provide a string value for the unique identifier of the user you want to send the message to. | 84350944036 |
Example Payload for List Users Conversations
{
"data": {
"ok": true,
"channels": [
{
"id": "COZ7e3d",
"name": "example channel",
"is_channel": true,
"is_group": false,
"is_im": false,
"is_private": false,
"is_archived": false,
"created": 6426934241,
"creator": "example",
"unlinked": 0,
"name_normalized": "example channel",
"shared_team_ids": [
"TW2oP78"
],
"purpose": {
"value": "This channel was created for an example response."
}
}
]
}
}
Post Block Message
Post a message to a slack channel | key: postBlockMessage
Input | Default | Notes | Example |
---|---|---|---|
Blocks code / Required blocks | A JSON array containing blocks (objects) that make up the desired message. Use Slack's Block Kit Builder (https://app.slack.com/block-kit-builder/) to build block messages. | ||
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Alt Message text / Required message | This message will override if your block cannot be sent | Hello from Prismatic! | |
Message Id string messageId | A unique identifier of a message or thread to reply to (thread_ts) | 84350944036 | |
Bot Username string username | The username of the bot the message will be sent from. This requires the 'chat:write.customize' scope. | exampleUser |
Example Payload for Post Block Message
{
"data": {
"ok": true,
"channel": "C011B7U3R9U",
"ts": "1646951430.367539",
"message": {
"type": "message",
"subtype": "bot_message",
"text": "The message I sent",
"ts": "1646951430.367539",
"username": "My Slack App",
"bot_id": "B036D2DCT54"
},
"response_metadata": {
"scopes": [
"identify",
"chat:write",
"chat:write.public",
"chat:write.customize"
],
"acceptedScopes": [
"chat:write"
]
}
}
}
Post Ephemeral Message
Post an ephemeral message to a user or channel | key: postEphemeralMessage
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Message text / Required message | The message to send the Slack channel. | Hello from Prismatic! | |
User Id string / Required userId | Provide a string value for the unique identifier of the user you want to send the message to. | 84350944036 | |
Bot Username string username | The username of the bot the message will be sent from. This requires the 'chat:write.customize' scope. | exampleUser |
Example Payload for Post Ephemeral Message
{
"data": {
"ok": true,
"message_ts": "1502210682.580145"
}
}
Post Message
Post a message to a slack channel | key: postMessage
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Message text / Required message | The message to send the Slack channel. | Hello from Prismatic! | |
Message Id string messageId | A unique identifier of a message or thread to reply to (thread_ts) | 84350944036 | |
Bot Username string username | The username of the bot the message will be sent from. This requires the 'chat:write.customize' scope. | exampleUser |
Example Payload for Post Message
{
"data": {
"ok": true,
"channel": "C011B7U3R9U",
"ts": "1646951430.367539",
"message": {
"type": "message",
"subtype": "bot_message",
"text": "The message I sent",
"ts": "1646951430.367539",
"username": "My Slack App",
"bot_id": "B036D2DCT54"
},
"response_metadata": {
"scopes": [
"identify",
"chat:write",
"chat:write.public",
"chat.write.customize"
],
"acceptedScopes": [
"chat:write"
]
}
}
}
Raw Request
Send raw HTTP request to Slack | key: rawRequest
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Data string data | The HTTP body payload to send to the URL. | {"exampleKey": "Example Data"} | |
Debug Request boolean debugRequest | false | Enabling this flag will log out the current request. | |
File Data string Key Value List fileData | File Data to be sent as a multipart form upload. | [{key: "example.txt", value: "My File Contents"}] | |
File Data File Names string Key Value List fileDataFileNames | File names to apply to the file data inputs. Keys must match the file data keys above. | ||
Form Data string Key Value List formData | The Form Data to be sent as a multipart form upload. | [{"key": "Example Key", "value": new Buffer("Hello World")}] | |
Header string Key Value List headers | A list of headers to send with the request. | User-Agent: curl/7.64.1 | |
Max Retry Count string maxRetries | 0 | The maximum number of retries to attempt. | |
Method string / Required method | The HTTP method to use. | ||
Query Parameter string Key Value List queryParams | A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2. | ||
Response Type string / Required responseType | json | The type of data you expect in the response. You can request json, text, or binary data. | |
Retry On All Errors boolean retryAllErrors | false | If true, retries on all erroneous responses regardless of type. | |
Retry Delay (ms) string retryDelayMS | 0 | The delay in milliseconds between retries. | |
Timeout string timeout | The maximum time that a client will await a response to its request | 2000 | |
URL string / Required url | Input the path only (/team.info), The base URL is already included (https://slack.com/api). For example, to connect to https://slack.com/api/team.info, only /team.info is entered in this field. | /team.info | |
Use Exponential Backoff boolean useExponentialBackoff | false | Specifies whether to use a pre-defined exponential backoff strategy for retries. |
Rename Conversation
Rename an existing conversation | key: renameConversation
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Conversation Name string / Required conversationName | The name of the Slack conversation. | Book Club | |
Debug boolean debug | When true, the payload will be logged. | ||
New Conversation Name string / Required newConversationName | The name of the Slack conversation. | Book Club |
Example Payload for Rename Conversation
{
"data": {
"ok": true,
"channel": {
"id": "C012AB3CD",
"name": "general",
"is_channel": true,
"is_group": false,
"is_im": false,
"created": 1449252889,
"creator": "W012A3BCD",
"is_archived": false,
"is_general": true,
"unlinked": 0,
"name_normalized": "general",
"is_read_only": false,
"is_shared": false,
"is_ext_shared": false,
"is_org_shared": false,
"pending_shared": [],
"is_pending_ext_shared": false,
"is_member": true,
"is_private": false,
"is_mpim": false,
"last_read": "1502126650.228446",
"topic": {
"value": "For public discussion of generalities",
"creator": "W012A3BCD",
"last_set": 1449709364
},
"purpose": {
"value": "This part of the workspace is for fun. Make fun here.",
"creator": "W012A3BCD",
"last_set": 1449709364
},
"previous_names": [
"specifics",
"abstractions",
"etc"
],
"num_members": 23,
"locale": "en-US"
}
}
}
Search All
Searches for messages and files matching a query. | key: searchAll
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Count string count | Number of items to return per page. | 80 | |
Debug boolean debug | When true, the payload will be logged. | ||
Highlight boolean highlight | false | Pass a value of true to enable query highlight markers. | false |
Page string page | 1 | Page number of results to return. | 1 |
Query string / Required query | Search query. May contains booleans, etc. | pickleface | |
Sort string sort | score | The method to sort the results. For example, member_count will sort by the number of members in the channel. | |
Sort Direction string sort_dir | desc | The direction to sort the results. For example, desc will sort the results in descending order. | |
Team Id string team_id | Encoded team id to search in, required if org token is used | T1234567890 |
Example Payload for Search All
{
"data": {
"files": {
"matches": [
{
"channels": [],
"comments_count": 1,
"created": 1508804330,
"display_as_bot": false,
"editable": false,
"external_type": "",
"filetype": "png",
"groups": [],
"id": "F7PKF1NR7",
"image_exif_rotation": 1,
"ims": [],
"initial_comment": {
"comment": "Sure! Here's the workflow diagram!",
"created": 1508804330,
"id": "Fc7NLL52E7",
"is_intro": true,
"timestamp": 1508804330,
"user": "U2U85N1RZ"
},
"is_external": false,
"is_public": true,
"mimetype": "image/png",
"mode": "hosted",
"name": "slack workflow diagram.png",
"original_h": 117,
"original_w": 128,
"permalink": "https://example.slack.com/files/U2U85N1RZ/F7PKF1NR7/slack_workflow_diagram.png",
"permalink_public": "https://slack-files.com/T2U81E2FZ-F7PKF1NR7-bea9143f18",
"pretty_type": "PNG",
"preview": null,
"public_url_shared": false,
"score": "0.99982661240974",
"size": 35705,
"thumb_160": "https://files.slack.com/files-tmb/T2U81E2FZ-F7PKF1NR7-19f33fc256/slack_workflow_diagram_160.png",
"thumb_360": "https://files.slack.com/files-tmb/T2U81E2FZ-F7PKF1NR7-19f33fc256/slack_workflow_diagram_360.png",
"thumb_360_h": 117,
"thumb_360_w": 128,
"thumb_64": "https://files.slack.com/files-tmb/T2U81E2FZ-F7PKF1NR7-19f33fc256/slack_workflow_diagram_64.png",
"thumb_80": "https://files.slack.com/files-tmb/T2U81E2FZ-F7PKF1NR7-19f33fc256/slack_workflow_diagram_80.png",
"timestamp": 1508804330,
"title": "slack workflow diagram",
"top_file": false,
"url_private": "https://files.slack.com/files-pri/T2U81E2FZ-F7PKF1NR7/slack_workflow_diagram.png",
"url_private_download": "https://files.slack.com/files-pri/T2U81E2FZ-F7PKF1NR7/download/slack_workflow_diagram.png",
"user": "U2U85N1RZ",
"username": "amy"
}
],
"pagination": {
"first": 1,
"last": 1,
"page": 1,
"page_count": 1,
"per_page": 20,
"total_count": 1
},
"paging": {
"count": 20,
"page": 1,
"pages": 1,
"total": 1
},
"total": 1
},
"messages": {
"matches": [
{
"channel": {
"id": "C2U86NC6M",
"is_ext_shared": false,
"is_mpim": false,
"is_org_shared": false,
"is_pending_ext_shared": false,
"is_private": false,
"is_shared": false,
"name": "general",
"pending_shared": []
},
"iid": "35692677-e60e-43d9-ac45-1987cea88975",
"next": {
"iid": "6f510ea1-e1d3-4f3f-bdb9-f9c6f6e9d609",
"text": "Thanks!",
"ts": "1508804378.000219",
"type": "message",
"user": "U2U85HJ7R",
"username": "john"
},
"permalink": "https://example.slack.com/archives/C2U86NC6M/p1508804330000296",
"previous": {
"iid": "aba8603c-0543-4fb2-9118-a5ac85f3d138",
"text": "Can you send me the Slack workflow diagram?",
"ts": "1508804301.000026",
"type": "message",
"user": "U2U85HJ7R",
"username": "john"
},
"team": "T2U81E2FZ",
"text": "uploaded a file: <https://example.slack.com/files/U2U85N1RZ/F7PKF1NR7/slack_workflow_diagram.png|slack workflow diagram> and commented: Sure! Here's the workflow diagram!",
"ts": "1508804330.000296",
"type": "message",
"user": "U2U85N1RZ",
"username": "amy"
}
],
"pagination": {
"first": 1,
"last": 1,
"page": 1,
"page_count": 1,
"per_page": 20,
"total_count": 1
},
"paging": {
"count": 20,
"page": 1,
"pages": 1,
"total": 1
},
"total": 1
},
"ok": true,
"posts": {
"matches": [],
"total": 0
},
"query": "diagram"
}
}
Search Files
Searches for files matching a query. | key: searchFiles
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Count string count | Number of items to return per page. | 80 | |
Debug boolean debug | When true, the payload will be logged. | ||
Highlight boolean highlight | false | Pass a value of true to enable query highlight markers. | false |
Page string page | 1 | Page number of results to return. | 1 |
Query string / Required query | Search query. May contains booleans, etc. | pickleface | |
Sort string sort | score | The method to sort the results. For example, member_count will sort by the number of members in the channel. | |
Sort Direction string sort_dir | desc | The direction to sort the results. For example, desc will sort the results in descending order. | |
Team Id string team_id | Encoded team id to search in, required if org token is used | T1234567890 |
Example Payload for Search Files
{
"data": {
"files": {
"matches": [
{
"channels": [],
"comments_count": 1,
"created": 1507850315,
"deanimate_gif": "https://files.slack.com/files-tmb/T2U81E2BB-F7H0D7ZBB-21624821e6/computer_deanimate_gif.png",
"display_as_bot": false,
"editable": false,
"external_type": "",
"filetype": "gif",
"groups": [],
"id": "F7H0D7ZBB",
"image_exif_rotation": 1,
"ims": [],
"is_external": false,
"is_public": true,
"mimetype": "image/gif",
"mode": "hosted",
"name": "computer.gif",
"original_h": 313,
"original_w": 500,
"permalink": "https://eventsdemo.slack.com/files/U2U85N1RZ/F7H0D7ZBB/computer.gif",
"permalink_public": "https://slack-files.com/T2U81E2BB-F7H0D7ZBB-85b7f5557e",
"pretty_type": "GIF",
"preview": null,
"public_url_shared": false,
"reactions": [
{
"count": 1,
"name": "stuck_out_tongue_winking_eye",
"users": [
"U2U85N1RZ"
]
}
],
"score": "0.38899223746309",
"size": 1639034,
"thumb_160": "https://files.slack.com/files-tmb/T2U81E2BB-F7H0D7ZBB-21624821e6/computer_160.png",
"thumb_360": "https://files.slack.com/files-tmb/T2U81E2BB-F7H0D7ZBB-21624821e6/computer_360.png",
"thumb_360_gif": "https://files.slack.com/files-tmb/T2U81E2BB-F7H0D7ZBB-21624821e6/computer_360.gif",
"thumb_360_h": 225,
"thumb_360_w": 360,
"thumb_480": "https://files.slack.com/files-tmb/T2U81E2BB-F7H0D7ZBB-21624821e6/computer_480.png",
"thumb_480_gif": "https://files.slack.com/files-tmb/T2U81E2BB-F7H0D7ZBB-21624821e6/computer_480.gif",
"thumb_480_h": 300,
"thumb_480_w": 480,
"thumb_64": "https://files.slack.com/files-tmb/T2U81E2BB-F7H0D7ZBB-21624821e6/computer_64.png",
"thumb_80": "https://files.slack.com/files-tmb/T2U81E2BB-F7H0D7ZBB-21624821e6/computer_80.png",
"timestamp": 1507850315,
"title": "computer.gif",
"top_file": false,
"url_private": "https://files.slack.com/files-pri/T2U81E2BB-F7H0D7ZBB/computer.gif",
"url_private_download": "https://files.slack.com/files-pri/T2U81E2BB-F7H0D7ZBB/download/computer.gif",
"user": "U2U85N1RZ",
"username": ""
}
],
"pagination": {
"first": 1,
"last": 3,
"page": 1,
"page_count": 1,
"per_page": 20,
"total_count": 3
},
"paging": {
"count": 20,
"page": 1,
"pages": 1,
"total": 3
},
"total": 3
},
"ok": true,
"query": "computer.gif"
}
}
Search Messages
Searches for messages matching a query. | key: searchMessages
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Count string count | Number of items to return per page. | 80 | |
Debug boolean debug | When true, the payload will be logged. | ||
Highlight boolean highlight | false | Pass a value of true to enable query highlight markers. | false |
Page string page | 1 | Page number of results to return. | 1 |
Query string / Required query | Search query. May contains booleans, etc. | pickleface | |
Sort string sort | score | The method to sort the results. For example, member_count will sort by the number of members in the channel. | |
Sort Direction string sort_dir | desc | The direction to sort the results. For example, desc will sort the results in descending order. | |
Team Id string team_id | Encoded team id to search in, required if org token is used | T1234567890 |
Example Payload for Search Messages
{
"data": {
"messages": {
"matches": [
{
"channel": {
"id": "C12345678",
"is_ext_shared": false,
"is_mpim": false,
"is_org_shared": false,
"is_pending_ext_shared": false,
"is_private": false,
"is_shared": false,
"name": "general",
"pending_shared": []
},
"iid": "cb64bdaa-c1e8-4631-8a91-0f78080113e9",
"permalink": "https://hitchhikers.slack.com/archives/C12345678/p1508284197000015",
"team": "T12345678",
"text": "The meaning of life the universe and everything is 42.",
"ts": "1508284197.000015",
"type": "message",
"user": "U2U85N1RV",
"username": "roach"
},
{
"channel": {
"id": "C12345678",
"is_ext_shared": false,
"is_mpim": false,
"is_org_shared": false,
"is_pending_ext_shared": false,
"is_private": false,
"is_shared": false,
"name": "random",
"pending_shared": []
},
"iid": "9a00d3c9-bd2d-45b0-988b-6cff99ae2a90",
"permalink": "https://hitchhikers.slack.com/archives/C12345678/p1508795665000236",
"team": "T12345678",
"text": "The meaning of life the universe and everything is 101010",
"ts": "1508795665.000236",
"type": "message",
"user": "",
"username": "robot overlord"
}
],
"pagination": {
"first": 1,
"last": 2,
"page": 1,
"page_count": 1,
"per_page": 20,
"total_count": 2
},
"paging": {
"count": 20,
"page": 1,
"pages": 1,
"total": 2
},
"total": 2
},
"ok": true,
"query": "The meaning of life the universe and everything"
}
}
Set Conversation Purpose
Set the purpose of an existing conversation | key: setConversationPurpose
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Conversation Purpose string / Required purpose | Provide a string value for the purpose of the given conversation. | Engineering |
Example Payload for Set Conversation Purpose
{
"data": {
"ok": true
}
}
Set Conversation Topic
Set the purpose of an existing conversation | key: setConversationTopic
Input | Default | Notes | Example |
---|---|---|---|
Channel Name or ID string / Required channelName | The name or static ID of the Slack channel. | general | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Conversation Topic string / Required topic | Provide a string value for the topic of the given conversation. | Engineering | |
User Id string / Required userId | Provide a string value for the unique identifier of the user you want to send the message to. | 84350944036 |
Example Payload for Set Conversation Topic
{
"data": {
"ok": true,
"channel": {
"id": "C012AB3CD",
"name": "general",
"is_channel": true,
"is_group": false,
"is_im": false,
"created": 1449252889,
"creator": "W012A3BCD",
"is_archived": false,
"is_general": true,
"unlinked": 0,
"name_normalized": "general",
"is_read_only": false,
"is_shared": false,
"is_ext_shared": false,
"is_org_shared": false,
"pending_shared": [],
"is_pending_ext_shared": false,
"is_member": true,
"is_private": false,
"is_mpim": false,
"last_read": "1502126650.228446",
"topic": {
"value": "For public discussion of generalities",
"creator": "W012A3BCD",
"last_set": 1449709364
},
"purpose": {
"value": "This part of the workspace is for fun. Make fun here.",
"creator": "W012A3BCD",
"last_set": 1449709364
},
"previous_names": [
"specifics",
"abstractions",
"etc"
]
}
}
}
Slack Block Message From Webhook
Post a block formatted message to a Slack channel from a webhook URL | key: postWebhookBlockMessage
Input | Default | Notes | Example |
---|---|---|---|
Blocks code / Required blocks | A JSON array containing blocks (objects) that make up the desired message. Use Slack's Block Kit Builder (https://app.slack.com/block-kit-builder/) to build block messages. | ||
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Alt Message text / Required message | This message will override if your block cannot be sent | Hello from Prismatic! |
Example Payload for Slack Block Message From Webhook
{
"data": {
"text": "ok"
}
}
Slack Message From Webhook
Post a message to a Slack channel from a webhook URL | key: postSlackMessage
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Message text / Required message | The message to send the Slack channel. | Hello from Prismatic! |
Example Payload for Slack Message From Webhook
{
"data": {
"text": "ok"
}
}
Update Message
Update the contents of an existing message | key: updateMessage
Input | Default | Notes | Example |
---|---|---|---|
Channel ID string / Required channelId | The static ID of the Slack channel. | C02MS7HV6KB | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
Message text / Required message | The message to send the Slack channel. | Hello from Prismatic! | |
Message Id string / Required messageId | A unique identifier of a message or thread to reply to (thread_ts) | 84350944036 |
Example Payload for Update Message
{
"data": {
"ok": true,
"channel": "C123ABC456",
"ts": "1401383885.000061",
"text": "Updated text you carefully authored",
"message": {
"text": "Updated text you carefully authored",
"user": "U34567890"
}
}
}
Upload File
Upload a new file to a slack conversation | key: uploadFile
Input | Default | Notes | Example |
---|---|---|---|
Channels string channels | Provide a comma separated list of channel names, or ids that the file will be shared in. | general,marketing | |
Connection connection / Required connection | The connection to use | ||
Debug boolean debug | When true, the payload will be logged. | ||
File Content data / Required fileContent | Provide the data for a file to be uploaded | ||
File Name string / Required fileName | Provide a name for the file. | reports.csv | |
File Type string / Required fileType | A full list of supported file types can be found here: https://api.slack.com/types/file#file_types | csv | |
Initial Comment string initialComment | The message text introducing the file in the specified channels when uploaded | Example message | |
Thread Reply string thread | Provide another message's ts value to upload this file as a reply. Never use a reply's ts value, use the parent instead. | u830hd230 | |
File Title string title | The title of the file as it will appear in the channel | Monthly Reports |
Example Payload for Upload File
{
"data": {
"ok": true,
"file": {
"id": "F0TD0GUTS",
"created": 1532294750,
"timestamp": 1532294750,
"name": "-.txt",
"title": "Untitled",
"mimetype": "text/plain",
"filetype": "text",
"pretty_type": "Plain Text",
"user": "U0L4B9NSU",
"editable": true,
"size": 11,
"mode": "snippet",
"is_external": false,
"external_type": "",
"is_public": true,
"public_url_shared": false,
"display_as_bot": false,
"username": "",
"url_private": "https://.../.txt",
"url_private_download": "https://...download/-.txt",
"permalink": "https://.../.txt",
"permalink_public": "https://.../.txt",
"edit_link": "https://.../.txt/edit",
"preview": "launch plan",
"preview_highlight": "<div class=\"CodeMirror cm-s-default CodeMirrorServer\" oncopy=\"if(event.clipboardData){event.clipboardData.setData('text/plain',window.getSelection().toString().replace(/\\u200b/g,''));event.preventDefault();event.stopPropagation();}\">\n<div class=\"CodeMirror-code\">\n<div><pre>launch plan</pre></div>\n</div>\n</div>\n",
"lines": 1,
"lines_more": 0,
"preview_is_truncated": false,
"comments_count": 0,
"is_starred": false,
"shares": {
"public": {
"C061EG9SL": [
{
"reply_users": [],
"reply_users_count": 0,
"reply_count": 0,
"ts": "1532294750.000001",
"channel_name": "general",
"team_id": "T061EG9R6"
}
]
}
},
"channels": [
"C061EG9SL"
],
"groups": [],
"ims": [],
"has_rich_preview": false
}
}
}