使用Microsoft团队时向Microsoft连接器服务发布时出现未分类错误

2024-04-20 02:56:23 发布

您现在位置:Python中文网/ 问答频道 /正文

当我在收到来自微软团队的消息后发布到连接器服务时,我得到了一个404响应,在正文中有这个。你知道吗

{"error":{"code":"Unclassified","message":""}}

这项服务与skype合作,并与团队合作,直到大约10天前。你知道吗

我尝试了ReplyToActivity和RespondToConversation端点。我还试着在会话id是的

代码可以在这里看到:https://github.com/Grungnie/microsoftbotframework/blob/FixTeamsError732/microsoftbotframework/response.py在方法reply\u to\u活动中。你知道吗

从Microsoft接收的消息(id标签略有更改)

{
   "text": "Test Message",
   "textFormat": "plain",
   "type": "message",
   "timestamp": "2017-03-27T11:55:33.983Z",
   "id": "1490615736123",
   "channelId": "msteams",
   "serviceUrl": "https://smba.trafficmanager.net/apac-client-ss.msg/",
   "from": {
      "id": "29:10U0pO0yzCqc_TZQImyaX1JGhe9KWpagDIwqtTl0moeT2lNC4PMrm9B2W_0w-Cr9tr5rty8vEZErb4yoyautked",
      "name": "Matthew Brown"
   },
   "conversation": {
      "id": "a:1lRzVTZeip__5jthfxCqiWX8koXTOg5OsFsnefe2kesHxvJAcJxNJs-TT3NvR1ote1PZZ_DQVkd5u5wsKmw2TQy53bvXOlXydDJjUUcolfphZWu2N-HuX8181rfRIMj7Q"
   },
   "recipient": {
      "id": "28:5e21d7a8-d1b5-4534-f549-f521712f5a64",
      "name": "PythonBotFramework"
   },
   "entities": [
      {
         "locale": "en-AU",
         "country": "AU",
         "platform": "Android",
         "type": "clientInfo"
      }
   ],
   "channelData": {
      "tenant": {
         "id": "5ghtef8a-55a8-4263-bd84-e03688a2ab2d"
      }
   }
}

标题

Host: microsoftbotframework.herokuapp.com
Connection: close
Contextid: tcid=5448949784053522007, server=EAP010254248242
Authorization: Bearer eyJ0eXAiOiJ....
User-Agent: Microsoft-SkypeBotApi (Microsoft-BotFramework/3.0)
Content-Type: application/json; charset=utf-8
X-Request-Id: 6d8510c4-e3ba-4e34-80b2-45305a38d022
X-Forwarded-For: 13.75.95.64
X-Forwarded-Proto: https
X-Forwarded-Port: 443
Via: 1.1 vegur
Connect-Time: 0
X-Request-Start: 1490615736123
Total-Route-Time: 0
Content-Length: 747

我的回答 网址

https://smba.trafficmanager.net/v3/conversations/a:1lRzVTZeip__5jthfxCqiWX8koXTOg5OsFsnefe2kesHxvJAcJxNJs-TT3NvR1ote1PZZ_DQVkd5u5wsKmw2TQy53bvXOlXydDJjUUcolfphZWu2N-HuX8181rfRIMj7Q/activities/1490615736123

标题

Authorization: Bearer eyJ0eXAgibJ....

身体

{
   "from": {
      "id": "28:5e21d7a8-d1b5-4534-f549-f521712f5a64",
      "name": "PythonBotFramework"
   },
   "type": "message",
   "timestamp": "2017-03-27T11:55:36.463971Z",
   "conversation": {
      "id": "a:1lRzVTZeip__5jthfxCqiWX8koXTOg5OsFsnefe2kesHxvJAcJxNJs-TT3NvR1ote1PZZ_DQVkd5u5wsKmw2TQy53bvXOlXydDJjUUcolfphZWu2N-HuX8181rfRIMj7Q"
   },
   "recipient": {
      "id": "29:10U0pO0yzCqc_TZQImyaX1JGhe9KWpagDIwqtTl0moeT2lNC4PMrm9B2W_0w-Cr9tr5rty8vEZErb4yoyautked",
      "name": "Matthew BROWN"
   },
   "text": "How bout no",
   "replyToId": "1490615736123",
   "serviceUrl": "https://smba.trafficmanager.net/apac-client-ss.msg/",
   "channelId": "msteams",
   "channelData": {
      "tenant": {
         "id": "5ghtef8a-55a8-4263-bd84-e03688a2ab2d"
      }
   },
   "textFormat": "plain"
}

**在29/3更改错误代码后更新。下面是以前的错误代码。你知道吗

{"errorCode":732,"message":""}

Tags: namehttpsidmessagenettype团队microsoft
1条回答
网友
1楼 · 发布于 2024-04-20 02:56:23

所以我犯了个错误

response_url = urljoin(self["serviceUrl"], "/v3/conversations/{}/activities/{}".format( conversation_id, reply_to_id))

urljoin正在从self[“serviceUrl”]中剥离url的最后一部分。这是预期的行为。似乎没有一个方法将url的两个部分连接在一起。我想这样做,因为微软有时发送以“/”结尾的url,有时不发送。我想我会写我自己的方法。你知道吗

相关问题 更多 >