2

根据文档,在授予权限后,我会收到这种 JSON 响应:

{
    "access_token": "xoxp-XXXXXXXX-XXXXXXXX-XXXXX",
    "scope": "incoming-webhook,commands,bot",
    "team_name": "Team Installing Your Hook",
    "team_id": "XXXXXXXXXX",
    "incoming_webhook": {
        "url": "https://hooks.slack.com/TXXXXX/BXXXXX/XXXXXXXXXX",
        "channel": "#channel-it-will-post-to",
        "configuration_url": "https://teamname.slack.com/services/BXXXXX"
    },
    "bot":{
        "bot_user_id":"UTTTTTTTTTTR",
        "bot_access_token":"xoxb-XXXXXXXXXXXX-TTTTTTTTTTTTTT"
    }
}

有没有办法确定哪个 slack 用户授予了访问权限?

4

1 回答 1

1

如果有人感兴趣,slack 团队最近添加user_id到输出中。此外,您可以调用 web api 方法auth.test,它将为您user_id提供是否已提供访问令牌。

于 2016-05-20T12:40:23.517 回答