Slack API打开新的DM(作用域和权限) [英] Slack API Opening a New DM (Scopes and Permissions)

查看:218
本文介绍了Slack API打开新的DM(作用域和权限)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用im.open Slack API调用与任意用户打开DM(直接消息).我向它发送了一个用户的user_id,我可以通过单击他们的同意按钮来获得它,以便开始一系列问题.我正在成功将数据发送到Slack API以及接收数据.我收到以下回应...

I am attempting to open a DM (Direct Message) with an arbitrary user using the im.open Slack API call. I am sending it a user's user_id that I obtain through their clicking of a consent button in order to begin a series of questions. I am sending data to the Slack API successfully along with receiving data. I am getting the following response...

 {
    "ok": false,
    "error": "missing_scope",
    "needed": "im:write",
    "provided": "identify,incoming-webhook,chat:write:user,files:write:user",
 }

我进入了应用程序页面并更改了应用程序的范围(我不是所有者,但是我的团队负责人(所有者)已授予协作者权限).这些是当前权限...

I have went into the application's page and changed the scope of the app (I am not the owner, but have been given collaborator permissions by my team lead (the owner)). These are the current permissions...

对于图像质量不佳,我深表歉意.范围如下...

I apologize for the poor quality of the image. The scopes are as follows...

  • 识别
  • incoming-webhook
  • 聊天:写:用户
  • files:write:user
  • im:write

更改之后,我仍然从Slack API得到相同的响应.以下是我发送给他们的内容(这是我的user_id,我不介意).

After this change, I am still getting the same response from the Slack API. The following is what I am sending them (it's my user_id, and I don't mind).

{
    "user": "U94155Z43"
}

感谢您的帮助.谢谢.

Any help is appreciated. Thanks.

推荐答案

我需要使用bot令牌"xoxb"代替我用于所有其他slack api调用的用户令牌"xoxp".

I needed to use the bot token "xoxb" instead of the user token "xoxp" which I had used for all other slack api calls.

这篇关于Slack API打开新的DM(作用域和权限)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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