usergroups.users.update 的权限被拒绝

Permission denied for usergroups.users.update

我正在尝试将用户添加到用户组(并尝试使用 API 调用 usergroups.users.update)

我正在使用范围为 usergroups:write 和 usergroups:read 的工作区令牌(完整列表:channels:read、channels:write、chat:write、groups:write, im:write, identity:read:user, usergroups:read, usergroups:write, users:read, users:read.email, users.profile:write )

有效载荷是:

{"usergroup":"SCGM0xxxx","users":"U5W2Rxxxx"}

(小写 xxxx 以隐藏身份)

POST 来自 Curl:

POST /api/usergroups.users.update HTTP/1.1

POST 请求 usergroups.users.update 的结果只是 returns

    {
     "ok" => false
     "error"  => "permission_denied"
     }

文档指出:

The user does not have permission to update the list of users for a User Group.

是否需要配置任何其他设置才能使此工作正常进行?更改 oauth 范围后,我重新安装了该应用程序。我同时添加了 usergroups:read 和 usergroups:write,我可以使用 API 调用 usergroups.list.

我遇到了同样的问题,我认为工作区令牌不起作用是一个错误。作为一种解决方法,我有幸进入管理设置并临时设置可以创建和禁用用户组的人:所有人,客人除外。这使我能够继续进行 API 调用。然后切换回来。

根据 slack 支持:

There’s a workspace preference that limits who can manage user groups. It’s likely that your workspace owners have locked this down. If the token you’re using does not belong to one of the members permitted to manage user groups, you’ll get back the “permission_denied” error. The settings would look like this: To find a list of workspace Owners you can head to your Account page: https://my.slack.com/account/workspace-settings#admins