You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Slack API conversations.setTopic返回invalid_json错误求助

问题原因

你的请求触发invalid_json错误的核心原因是:JSON数据中使用了中文双引号(“”),而标准JSON语法强制要求使用英文双引号(""),Slack接口无法解析非标准的引号格式。

正确请求示例

以下是修正后的curl命令:

curl --request POST \
  --url https://slack.com/api/conversations.setTopic \
  --header 'Authorization: Bearer xxxxxxx' \
  --header 'Content-type: application/json; charset=utf-8' \
  --data '{"channel": "xxxxxxxxx", "text": "this is a test"}'
额外注意事项
  • 确认Authorization头中的Bearer令牌具备对应权限:公开频道需channels:manage,私有频道需groups:manage,即时消息需im:manage
  • channel参数必须填写目标频道的ID,不能使用频道名称

内容的提问来源于stack exchange,提问作者hachemon

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 10:15:27