首页 > 解决方案 > 此请求的授权已被拒绝(Skype REST API)

问题描述

晚上好,社区专家。

我正在使用 REST API (Bot Framework) 将我的应用程序与 Skype 集成。直到今天,一切都运行良好。早上,在检查应用程序的功能时,我注意到 Skype 中没有显示机器人的响应。我决定通过«Postman»发送消息,并收到以下回复:

{
    "message": "Authorization has been denied for this request."
}

我认为令牌可能有问题。通过下面的请求,我得到了一个新的,但它没有帮助:

curl -k -X POST https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token -d "grant_type=client_credentials&client_id=<APP ID>&client_secret=<APP PASWORD>&scope=https%3A%2F%2Fapi.botframework.com%2F.default"

这是我的 «Postman» POST HTTPS 查询设置:

URL:
https://smba.trafficmanager.net/apis/v3/conversations/<CONVERSATION ID>/activities/<MESSAGE ID>

HEADERS:
Postman-Token: <calculated when request is sent>
Content-Lenght: <calculated when request is sent>
Host: <calculated when request is sent>
Content-Type: application/json
Authorization: Bearer 0SzRndyIsImtpZCI6ImppYk5ia0ZTU2JteFBZck45Q0...

BODY:
{
    "type": "message",
    "from": {
        "id": <BOT ID>,
        "name": <BOT NAME>
    },
   "recipient": {
        "id": <USER ID>,
        "name": <USER NAME>
    },
    "text": <MESSAGE>
}

请告诉我可能是什么问题?昨天一切正常!SSL证书可能有问题吗?还是应该以其他方式传递 Authorization 参数?先感谢您!

标签: pythonapipostmanbotframeworkskype

解决方案


推荐阅读