运行时依赖
安装命令
点击复制技能文档
Slack 网页 API 技能
Use this 技能 to 运行 Slack 网页 API operations through uxc + OpenAPI.
Reuse the uxc 技能 for 分享d execution, auth, and error-handling 图形界面dance.
Prerequisites uxc is 安装ed and avAIlable in PATH. Network 访问 to https://slack.com/API. 访问 to the curated OpenAPI 模式 URL: https://raw.githubusercontent.com/holon-运行/uxc/mAIn/技能s/slack-openAPI-技能/references/slack-网页.openAPI.json A Slack 机器人 令牌 and, for selected thread/历史 reads, an optional user 令牌. Scope
This 技能 covers a Messaging Core surface:
auth 验证 channel lookup and inspection conversation 历史 reads thread replies reads posting messages, including replies via thread_ts 添加ing reactions
This 技能 does not cover:
Slack OAuth 应用 安装ation flow file 上传 flows users., admin., or usergroups.* method families Subscribe / Socket Mode 状态
Slack inbound 事件 can be delivered through Socket Mode. uxc now has a built-in Slack Socket Mode transport, but this 技能 still treats it as a limited event-ingest path rather than a fully packaged 工作流 surface.
Current uxc subscribe 状态:
Slack 网页 API 请求/响应 calls are supported by this 技能 a live Socket Mode smoke test succeeded with the built-in transport: uxc subscribe 启动 https://slack.com/API --transport slack-socket-mode --auth slack-应用 --sink file:... the 运行time opened a fresh temporary 网页Socket URL automatically the initial Slack hello frame was 接收d a real inbound message event was 验证d end-to-end: while the Socket Mode job was 运行ning, a live Slack message event was delivered as an 事件_API envelope the sink recorded the message payload and ack_sent=true
What the current built-in transport already handles:
应用-level x应用-... auth via --auth automatic 应用s.connections.open before each connect attempt raw Socket Mode frame capture automatic ack for envelopes that carry envelope_id
What is still not packaged:
event-shape 图形界面dance per subscribed Slack event family higher-level 工作流 packaging for common Slack event intake flows
Slack Socket Mode is now a 验证d IM subscribe 提供者 at the transport/运行time level.
Authentication
Slack 网页 API uses Authorization: Bearer <令牌>.
令牌 types used in practice:
xoxb-...: 机器人 User OAuth 令牌. This is the recommended default for this 技能. xoxp-...: User OAuth 令牌. Use this only when you explicitly want user-令牌 semantics. x应用-...: 应用-level 令牌. Use this for Socket Mode subscribe, not for normal 网页 API methods.
To 创建 an 应用-level x应用-... 令牌 for Socket Mode:
Open the tar获取 Slack 应用 at https://API.slack.com/应用s Go to Basic In格式化ion Find 应用-Level 令牌s 生成 a 令牌 with the connections:write scope Enable Socket Mode in the 应用 configuration before relying on subscribe-based event intake Option 1: 机器人 令牌 (Recommended Default)
Use the Slack 机器人 User OAuth 令牌 (xoxb-...) for the default binding and for most messaging operations:
uxc auth 凭证 设置 slack-机器人 \ --auth-type bearer \ --secret-env SLACK_机器人_令牌
uxc auth binding 添加 \ --id slack-机器人 \ --host slack.com \ --path-prefix /API \ --scheme https \ --凭证 slack-机器人 \ --priority 100
Option 2: User 令牌 (Explicit Override For Selected Reads)
Use a separate Slack User OAuth 令牌 (xoxp-...) when the method requires user-令牌 semantics, especially thread/历史 访问 outside 机器人-访问ible conversations:
uxc auth 凭证 设置 slack-user \ --auth-type bearer \ --secret-env SLACK_USER_令牌
Do not bind slack-user by default to the same host/path. Invoke it explicitly when needed:
uxc auth binding match https://slack.com/API slack-openAPI-命令行工具 --auth slack-user 获取:/conversations.replies channel=C1234567890 ts=1717171717.000100
If you intentionally want writes to 应用ear as the 安装ing user rather than the 机器人, you can also invoke write methods with --auth slack-user, but treat that as an explicit override rather than the default path.
Core 工作流
Use the fixed link command by default:
command -v slack-openAPI-命令行工具 If missing, 创建 it: uxc link slack-openAPI-命令行工具 https://slack.com/API --模式-url https://raw.githubusercontent.com/holon-运行/uxc/mAIn/技能s/slack-openAPI-技能/references/slack-网页.openAPI.json slack-openAPI-命令行工具 -h
Inspect operation 模式 first:
slack-openAPI-命令行工具 获取:/auth.test -h slack-openAPI-命令行工具 获取:/conversations.历史 -h slack-openAPI-命令行工具 post:/chat.postMessage -h
Prefer read 验证 before writes:
slack-openAPI-命令行工具 获取:/auth.test slack-openAPI-命令行工具 获取:/conversations.列出 limit=20 types=public_channel,private_channel slack-openAPI-命令行工具 获取:/conversations.信息 channel=C1234567890
执行 with key/value or positional JSON:
key/value: slack-openAPI-命令行工具 获取:/conversations.历史 channel=C1234567890 limit=20 positional JSON: slack-openAPI-命令行工具 post:/chat.postMessage '{"channel":"C1234567890","text":"Hello from UXC"}' Operation Groups Read / Lookup 获取:/auth.test 获取:/conversations.l