如何修复Slack(rtm.connect)API中缺少作用域的错误? [英] How to fix missing scope error in Slack (rtm.connect) API?

查看:201
本文介绍了如何修复Slack(rtm.connect)API中缺少作用域的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将rtm.connect方法与自己的令牌一起使用时,测试仪会向我返回错误的响应.

When I try to use the rtm.connect method with own token, tester returns me a false response.

URL:https://slack.com/api/rtm.connect?token=xoxp-532016xxxxx-53xxxxxx-536743xxxxxx-9211bedc4bfe9ddfexxxxxxxxxxxxxx&pretty=1

{
    "ok": false,
    "error": "missing_scope",
    "needed": "rtm:stream",
    "provided": "identify,incoming-webhook,channels:history,im:history,channels:read,im:read,team:read,users:read,users:read.email,users.profile:read,chat:write:user,files:write:user"
}

请求中我缺少什么?为什么会出现此missing_scope错误?我已经关注了Slack文档.

What am I missing in request? Why does this missing_scope error occur? I already followed the Slack documentation.

推荐答案

您需要先创建用户bot.按照此链接并创建一个.

You need to first create user bot. Follow this link and create one.

然后,您将在左侧导航栏中的安装应用下获得 Bot用户OAuth访问令牌.

Then you will get Bot User OAuth Access Token under Install App in left Navigation bar.

使用此 Bot用户OAuth访问令牌进行上述请求.

这篇关于如何修复Slack(rtm.connect)API中缺少作用域的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆