# Slack

Slack is a cloud-based messaging platform designed to improve communication and collaboration within teams. It offers features such as direct messaging, group chats, file sharing, and integration with numerous third-party applications to streamline workflows and enhance productivity in corporate environments.

Slack's integration with ZBrain enables these comprehensive capabilities:

**Add Reaction to Message**

Add an emoji reaction to a message.

**Send Message To A User**

Send a message to a user

**Send Message To A Channel**

Send a message to a channel

**Request Approval from A User**

Send an approval message to a user and then wait until the message is approved or disapproved.

**Request Approval in a Channel**

Send an approval message to a channel and then wait until the message is approved or disapproved.

**Request Action from A User**

Send a message to a user and wait until the user selects an action

**Request Action in A Channel**

Send a message in a channel and wait until an action is selected

**Upload file**

Upload the file without sharing it to a channel or user

**Search messages**

Searches for messages matching a query

**Find User by Email**

Finds a user by matching against their email address.

**Find User by Handle**

Finds a user by matching against their Slack handle.

**Update message**

Update an existing message

**Create Channel**

Creates a new channel.

**Update Profile**

Update basic profile fields such as name or title.

**Get channel history**

Retrieve all messages from a specific channel ("conversation") between specified timestamps.

**Set User Status**

Sets a user's custom status

**Markdown to Slack format**

Convert Markdown-formatted text to Slack's pseudo-markdown syntax

**Custom API Call**

Make a custom API call to a specific endpoint

### **How to Connect Slack to ZBrain Flow?** <a href="#how-to-connect-slack-to-zbrain-flow" id="how-to-connect-slack-to-zbrain-flow"></a>

To integrate Slack with ZBrain Flow, follow these steps to select and utilize the desired capabilities:

1. **Search for the Slack Component**: Search the Slack component within the ZBrain interface.
2. **Select the Required Capability**: From a range of comprehensive capabilities offered, select the desired element.

### **Additional Settings to Create Slack Connection** <a href="#additional-settings-to-create-slack-connection" id="additional-settings-to-create-slack-connection"></a>

**Provide these details to set up the connection:**

* **Connection Name**: Designate a unique name for this connection to easily identify it among others.
* **Connect**: Click to authenticate and establish a connection with Slack using your account credentials.

### **Additional Settings to** **Add Reaction to Message** <a href="#additional-settings-to-add-reaction-to-message" id="additional-settings-to-add-reaction-to-message"></a>

* **Connection**: Select the previously configured Slack connection to interact with.
* **Channel**: Specify the Slack channel ID where the message is located.
* **Message Timestamp**: Enter the unique timestamp of the message to which you want to add a reaction.
* **Reaction (emoji) name**: Provide the name of the emoji to use as a reaction, like :+1: for a thumbs up.

### **Additional Settings to Send Message To A User** <a href="#additional-settings-to-send-message-to-a-user" id="additional-settings-to-send-message-to-a-user"></a>

* **Connection**: Choose your configured Slack connection for sending messages.
* **User**: Enter the Slack user ID to whom the message will be sent.
* **Message**: Type the message you wish to send to the user.
* **Username**: Specify the username of the bot that will appear as the sender.
* **Profile Picture**: Provide a URL for the profile picture to represent the bot.
* **Block Kit Blocks**: Enter JSON formatted Slack Block Kit components to structure the message.

### **Additional Settings to Send Message To A Channel** <a href="#additional-settings-to-send-message-to-a-channel" id="additional-settings-to-send-message-to-a-channel"></a>

* **Connection**: Select the configured Slack connection for sending channel messages.
* **Channel**: Choose the Slack channel where the message will be posted.
* **Message**: Write the content of the message to be sent to the channel.
* **Username**: Specify the username of the bot that will appear as the sender in the channel.
* **Profile Picture**: Provide the URL for the profile picture to represent the bot.
* **Attachment**: Attach files to the message by providing URLs.
* **Threads**: Enter the timestamp of a parent message to send this as a reply in a thread.
* **Block Kit Blocks**: Input JSON formatted Slack Block Kit components to structure the message elaborately.

### **Additional Settings to Request Approval from A User** <a href="#additional-settings-to-request-approval-from-a-user" id="additional-settings-to-request-approval-from-a-user"></a>

* **Connection**: Choose the configured Slack connection to interact with users.
* **User**: Select the specific user in Slack to request approval from.
* **Message**: Input the message detailing what approval is being requested.
* **Username**: Specify the username of the bot that will appear when requesting approval.
* **Profile Picture**: Provide the URL for the profile picture to be used by the bot when sending the request.

### **Additional Settings to Request Approval in a Channel** <a href="#additional-settings-to-request-approval-in-a-channel" id="additional-settings-to-request-approval-in-a-channel"></a>

* **Connection**: Choose the configured Slack connection for channel interactions.
* **Channel**: Select the Slack channel where approval is to be requested.
* **Message**: Enter the approval request message to be posted in the selected channel.
* **Username**: Specify the bot's username that will appear when sending the approval request.
* **Profile Picture**: Provide the URL for the profile picture to be used by the bot in the approval request.

### **Additional Settings to Request Action from a User** <a href="#additional-settings-to-request-action-from-a-user" id="additional-settings-to-request-action-from-a-user"></a>

* **Connection**: Select the configured Slack connection to interact with users.
* **User**: Choose the Slack user from whom an action is requested.
* **Message**: Type the message to send, prompting the user for action.
* **Action Buttons**: Add interactive buttons that the user can click to respond to the request.
* **Username**: Specify the username of the bot that will appear when sending the message.
* **Profile Picture**: Provide the URL for the bot's profile picture to use when sending the message.

### **Additional Settings to Request Action in a Channel** <a href="#additional-settings-to-request-action-in-a-channel" id="additional-settings-to-request-action-in-a-channel"></a>

* **Connection**: Choose the configured Slack connection to interact with a channel.
* **Channel**: Select the Slack channel where the action request will be posted.
* **Message**: Enter the message to prompt channel members for action.
* **Action Buttons**: Configure interactive buttons for channel members to respond to the request.
* **Username**: Specify the username of the bot that will display when the message is posted.
* **Profile Picture**: Provide the URL for the bot's profile picture to be shown in the message.

### **Additional Settings to Upload File** <a href="#additional-settings-to-upload-file" id="additional-settings-to-upload-file"></a>

* **Connection**: Choose the Slack connection through which the file will be uploaded.
* **Attachment**: Upload the file to be shared in Slack.
* **Title**: Provide a title for the uploaded file (optional).
* **Filename**: Specify the name of the file as it should appear in Slack.
* **Channel**: Select the Slack channel where the file will be posted.

### **Additional Settings to Search Messages** <a href="#additional-settings-to-search-messages" id="additional-settings-to-search-messages"></a>

* **Connection**: Select the appropriate Slack connection for executing the search.
* **Search query**: Enter the keywords or phrases to search for within Slack messages.

### **Additional Settings to Find Users by Email** <a href="#additional-settings-to-find-users-by-email" id="additional-settings-to-find-users-by-email"></a>

* **Connection**: Choose the relevant Slack connection to use for this operation.
* **Email**: Input the email address to search for the corresponding Slack user.

### **Additional Settings to Find User by Email Handle** <a href="#additional-settings-to-find-user-by-email-handle" id="additional-settings-to-find-user-by-email-handle"></a>

* **Connection**: Choose the relevant Slack connection to use for this operation.
* **Handle**: Input the user handle (display name), omitting the "@" symbol, to find the corresponding Slack user.

### **Additional Settings to Update Message** <a href="#additional-settings-to-update-message" id="additional-settings-to-update-message"></a>

* **Connection**: Choose the existing Slack connection.
* **Channel**: Select the channel containing the message to be updated.
* **Message Timestamp**: Enter the timestamp of the original message you want to modify.
* **Message**: Input the updated message text to replace the existing content.
* **Block Kit blocks**: Optionally, add Slack’s Block Kit components to format the updated message content. For this, see <https://api.slack.com/block-kit> for specs.

  .

### **Additional Settings to Create Channel** <a href="#additional-settings-to-create-channel" id="additional-settings-to-create-channel"></a>

* **Connection**: Choose the Slack connection to use.
* **Channel Name**: Specify the name of the new channel.
* **Is Private?**: Toggle to specify if the channel should be private.

### **Additional Settings to Update Profile** <a href="#additional-settings-to-update-profile" id="additional-settings-to-update-profile"></a>

* **Connection**: Select the Slack connection to use.
* **First Name**: Enter the first name for the user profile.
* **Last Name**: Enter the last name for the user profile.
* **Email**: Update the user's email address; note this will notify both old and new addresses.
* **User**: Specify the user ID to update; only admins can update other user profiles.

### **Additional Settings to Get Channel History** <a href="#additional-settings-to-get-channel-history" id="additional-settings-to-get-channel-history"></a>

* **Connection**: Select the Slack connection to use.
* **Channel**: Enter the ID of the Slack channel to retrieve history.
* **Oldest**: Set the oldest message timestamp to include in the results.
* **Latest**: Specify the latest message timestamp to retrieve up to.
* **Inclusive**: Toggle to include messages with the specified oldest or latest timestamps.
* **Include all metadata**: Choose to retrieve all metadata associated with each message.

### **Additional Settings to Set User Status** <a href="#additional-settings-to-set-user-status" id="additional-settings-to-set-user-status"></a>

* **Connection**: Choose your Slack connection.
* **Text**: Enter the text for the user status.
* **Emoji**: Specify an emoji shortcode to display with the status, such as :smile:.
* **Expires at**: Enter a Unix timestamp, after which the status will expire; leave blank for a non-expiring status.

### **Additional Settings to Markdown to Slack Format** <a href="#additional-settings-to-markdown-to-slack-format" id="additional-settings-to-markdown-to-slack-format"></a>

* **Markdown text**: Input your markdown text to convert it into Slack's message formatting style.

### **Additional Settings to Custom API Call** <a href="#additional-settings-to-custom-api-call" id="additional-settings-to-custom-api-call"></a>

* **Connection**: Select your Slack connection.
* **URL**: Enter the endpoint URL for the custom API call.
* **Method**: Choose the HTTP method for the API call, like GET or POST.
* **Headers**: Add custom headers as needed for the API request.
* **Query Parameters**: Define query parameters to include in the API request.
* **Body**: Input the JSON or other data to be sent in the API request body.
* **No Error on Failure:** Enables a process to continue without stopping or flagging an error if a step fails.
* **Timeout**: Set a timeout in seconds for the API call.
* **User token**: Toggle to use user token instead of bot token


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zbrain.ai/zbrain-documentation/zbrain-builder/flows/flow-components/slack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
