UiPath Documentation
activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

传统“集成”活动

上次更新日期 2026年5月18日

设置

简介

要启用 Slack 活动,您必须在Slack 作用域活动中输入身份验证详细信息。这些身份验证详细信息使机器人能够代表您执行操作并访问您允许的数据。

要生成和授予身份验证详细信息,并开始构建自动化项目,请完成以下步骤:

  1. 创建新的 Slack 应用程序(无需编码)
  2. 添加应用程序权限
  3. 将应用程序安装到工作区
  4. 构建项目

After creating your app, Slack assigns it a unique Client ID, Client Secret (i.e. app credentials), and an OAuth Access Token (for unattended automation) that you'll enter in the Slack Scope activity's authentication properties.

步骤

Before using the Slack activities, follow the steps below to generate or collect the required input data for the Slack Scope activity.

1. 创建 Slack 应用程序

要使用 Slack 活动,您可以创建一个简单的单一工作区应用程序。以下步骤和示例假定您拥有现有工作区,并且是该工作区的成员。

  1. 登录到您的 Slack 工作区或打开 Slack 桌面应用程序。

  2. 转到您的 Apps ,然后单击“创建新应用程序”按钮。

  3. Enter your App Name, select the Development Slack Workspace and click the Create App button.

After you create your app, you're taken to the Basic Information page. This is where you can find the Client ID and Client Secret that you'll need for attended automation authentication in the Slack Scope activity.

Before you copy and paste these into your activity, you should configure the OAuth & Permissions features by following the steps in the next section.

备注:

虽然在技术上可以,但我们不建议这样做,因为您需要与他们共享您的客户端密码。如果您有兴趣与团队成员共享应用程序,您可以使用 Unattended 自动化模式,因为它依赖可共享的 OAuth 访问令牌。

2. 添加应用程序权限

使用作用域向应用程序添加权限。作用域定义了此应用程序可以调用的 API 方法,以及该应用程序在安装该应用程序的工作区中可以访问的信息。许多作用域仅限于特定资源,例如频道或文件。

备注:

如果您仅计划运行有人值守的自动化,则不需要将作用域直接添加到应用程序。如果您运行 Attended 自动化,请使用Slack 作用域活动中的“作用域”属性选择作用域。由于在应用程序中设置作用域可同时启用 Unattended 和 Attended 自动化,因此我们建议您在开始使用活动包之前完成以下步骤;这使您可以在模式之间自由切换。

  1. In the left-hand navigation, click the OAuth & Permissions.

  2. In the Redirect URLs section, click the Add New Redirect URL button and enter your URL.

    • 如果您不知道应输入的 URL,可以暂时将其留空。

    • When you try connecting to your app with the Slack Scope activity for the first time (using attended automation) the activity opens a new web page that displays an OAuth Error. This error includes the redirect URL (i.e., Passed URI) that your workspace is using. You can copy this URL and enter it as your Redirect URL .

  3. “作用域”部分中,添加要分配给应用程序的权限作用域,然后单击“保存更改”按钮(请参阅下一部分中要添加的作用域的完整列表)。

要添加的作用域

The following are the scopes required for the different Slack activities. Also included in the table is each scope's mapping to to the Scopes property values from the Slack Scope activity.

范围活动“作用域”属性
channels:write
修改公共频道
创建频道
邀请加入频道
加入频道
离开频道
从频道中删除
发送消息
PublicChannels
组:写入
修改您的私人频道
邀请加入频道
离开频道
从频道中删除
发送消息
PrivateChannels
我:写
修改用户的直接消息
邀请加入频道
离开频道
从频道中删除
发送消息
DirectMessages
mpim:write
更改用户的群组消息
邀请加入频道
离开频道
从频道中删除
发送消息
GroupMessages
文件:写入:用户
以用户身份上传和修改文件
发送消息文件
文件:读取
访问工作区的文件、注释和关联信息
下载文件
发送消息
文件
channels:read
访问有关用户公共频道的信息
获取消息PublicChannels
组:读取
访问有关用户私人频道的信息
获取消息PrivateChannels
im:read
访问有关用户直接消息的信息
获取消息DirectMessages
mpim:读取
访问有关用户的群组消息的信息
获取消息GroupMessages
channels:history
访问用户的公共频道
获取回复PublicChannels
组:历史记录
访问用户私人频道中的内容
获取回复PrivateChannels
im:history
访问用户直接消息中的内容
获取回复DirectMessages
mpim:历史记录
访问用户的群组消息
获取回复GroupMessages
聊天:写入:用户
以用户身份发送消息
回复
发送消息
聊天
搜索:已读
搜索工作区的内容
搜索(包含在 DirectMessage 和/或 GroupMessage 中)
users.profile: 写入
修改用户的个人资料
更新状态用户
用户:read.email
查看工作区成员的电子邮件地址
邀请加入频道
从频道中删除
用户
users:read
查看工作区的成员列表及其联系信息
邀请加入频道
从频道中删除
用户

选择作用域后,即可按照下一部分中的步骤将应用程序安装到工作区。

3. 将您的应用程序安装到工作区

根据工作区的管理方式,您可能需要请求安装应用程序。

  1. In the OAuth Tokens & Redirects URLs section, click the Install App to Workspace button or Request to Install button.

  2. After the app is installed, an OAuth Access Token is generated.

    • Similar to the Client ID and Client Secret, the OAuth Access Token is used for authentication purposes. The differences between the two become applicable when run your automation project.
      • If running attended automation, the Slack Scope activity needs values in the Client ID, Client Secret, Scopes properites.

      • If running unattended automation, the Slack Scope activity only needs a value in the OAuth Access Token property.

4. 构建项目

  1. 创建一个新的自动化项目。
    1. 打开 UiPath Studio。

    2. Under New Project, click Process (this opens a New Blank Process window).

    3. Enter a project Name, Location, and Description.

    4. 单击“创建”。

  2. Install the UiPath.Slack.Activities package.
    1. In the Design ribbon, click Manage Packages (this opens the Manage Packages window).
    2. Under All Packages, click Go!
    3. In the Search bar, enter Slack.
    4. Click, install, and accept the license for the UiPath.Slack.Activities.
      • 有关 Uipath Studio 包的更多信息,请参阅 Studio 指南中的管理包

操作完毕!

现在您已完成设置,可以开始将 Slack 活动添加到项目中。

后续步骤

要亲身体验学习并快速开始使用活动,请参阅快速入门指南。这些指南提供分步说明,以帮助您创建不同活动的工作示例,以便您可以验证与 Slack 工作区的连接并熟悉输入/输出属性。

要了解有关 Slack 活动(包括示例属性输入/输出)的更多信息,请参阅活动页面以获取完整的活动列表以及活动详细信息页面的链接。

  • 简介
  • 步骤
  • 1. 创建 Slack 应用程序
  • 2. 添加应用程序权限
  • 3. 将您的应用程序安装到工作区
  • 4. 构建项目
  • 后续步骤

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新