【发布时间】:2020-03-02 16:26:41
【问题描述】:
我对 Bot Framework 很陌生,正在探索解决方案。
我正在尝试在 android 应用程序(以及之后的 python 烧瓶应用程序)中使用 microsoft bot 框架作为 API 调用。为此,我想弄清楚如何向我的机器人发送消息并通过邮递员
接收答案现在,我的机器人已在团队和网络聊天中启动并运行。我正在使用 bot 服务来利用 microsoft bot 框架。我的应用在 Heroku 上运行,而机器人托管在 Azure 上。
我已经检查了 bot 服务上的直线通道,但 这是为网络聊天返回一个 iframe,我想通过 python、java 等以编程方式发送我的消息作为 api 调用
我还检查了有关 v3 bot 框架的 stackoverflow 问题,并尝试了以下方法: How to connect my python bot to microsoft bot connector
Send message from Postman to Microsoft Bot
https://pypi.org/project/botframework-connector/
1° 在第二个 stackoverflow url 之后,我可以访问我的不记名令牌:
{
"token_type": "Bearer",
"expires_in": 3600,
"ext_expires_in": 3600,
"access_token": "eyJ0eXAiOiJKV1QiL***********************************ObNWg"
}
2° 然后为邮递员提供带有此 url https://directline.botframework.com/v3/directline/conversations/ 的不记名令牌
还有这个 json 原始正文:
{
"type": "message",
"from": {
"id": "user1"
},
"text": "hello"
}
这是返回:
{
"error": {
"code": "BadArgument",
"message": "Missing token or secret"
}
}
如前所述,我是新手,因此对上述内容的任何见解将不胜感激!
【问题讨论】:
标签: botframework postman