【问题标题】:Skype Bot Rest API, 403 The bot is not allowed to perform the requested operationSkype Bot Rest API, 403 不允许机器人执行请求的操作
【发布时间】:2017-11-15 21:57:05
【问题描述】:

所以我使用了一个帐户并向我的 Skype 机器人发送消息。

收到的消息:{"text":"test","type":"message","timestamp":"2017-11-15T21:52:10.379Z","id":"1510782730376","channelId ":"skype","serviceUrl":"https://smba.trafficmanager.net/apis/","from":{"id":"29:1tJkKyeNp1o5xbMfK9hxF_U2s7huwsAKi4LMD0kOJbkg"},"conversation":{"id":"29:1tJkKyeNp1o5xbMfK9hxF_U2s7huwsAKiJbkg0}}" ":{"id":"28:8a75f591-62bf-422b-be6c-4b4b8bd1a576","name":"SKYPE_BOT"},"entities":[{"locale":"ru-RU","country": "RU","platform":"Windows","type":"clientInfo"}],"channelData":{"text":"test"}}

向 URL 发送“POST”请求:https://smba.trafficmanager.net/apis/v3/conversations/29:1tJkKyeNp1o5xbMfK9hxF_U2s7huwsAKi4LMD0kOJbkg/activities/1510782730376 发布参数:{"replyToId":"1510782730376","re​​cipient":{"id":"29:1tJkKyeNp1o5xbMfK9hxF_U2s7huwsAKi4LMD0kOJbkg"},"from":{"name":"SKYPE_BOT","id":"28:8a75f591- 62bf-422b-be6c-4b4b8bd1a576"},"text":"你好,测试","type":"message","locale":"ru","conversation":{"id":"29:1tJkKyeNp1o5xbMfK9hxF_U2s7huwsAKi4LMD0kOJbkg" }}

响应代码:403 响应消息:禁止

403 不允许机器人执行请求的操作。

我做错了什么?

【问题讨论】:

    标签: botframework http-status-code-403 skype


    【解决方案1】:

    要与 Bot Connector 服务通信,您必须指定一个 每个 API 请求的 Authorization 标头中的访问令牌,使用 这种格式:

    授权:承载 ACCESS_TOKEN

    来自:https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-authentication#bot-to-connector

    【讨论】:

    • 这是我的标题:{Authorization=Bearer eyJ0eXAiOiJKV1QiLC............, Content-Type=application/json; charset=utf-8}
    • 请有任何想法
    • @FrankSinatra 抱歉,根据所提供的信息,我没有任何建议。你能在某处分享你的机器人代码吗?
    • 做到了,在 git 上共享。我已通过电子邮件将链接发送给您
    猜你喜欢
    • 2013-11-22
    • 2021-05-03
    • 1970-01-01
    • 2017-03-21
    • 2018-01-24
    • 1970-01-01
    • 2017-04-01
    • 2023-03-10
    • 2017-05-14
    相关资源
    最近更新 更多