确定哪个松弛用户已授予访问令牌

时间:2016-02-25 13:24:27

标签: slack-api slack

根据docs,在获得许可后,我收到了这种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"
    }
}

有没有办法确定哪个松弛用户已授予访问权限?

1 个答案:

答案 0 :(得分:1)

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