[英]Unclassified Error when posting to Microsoft Connector Service when using Microsoft Teams
When I post to the Connector Service after receiving a message from Microsoft teams I am getting a 404 response with this in the body. 当我收到来自Microsoft团队的消息后发布到Connector服务器时,我收到了404响应。
{"error":{"code":"Unclassified","message":""}}
The service is working with skype and was working with teams until about 10 days ago. 该服务正在与Skype合作,并与团队合作,直到大约10天前。
I have tried both the ReplyToActivity and RespondToConversation endpoints. 我已经尝试了ReplyToActivity和RespondToConversation端点。 I also tried encoding the : in the conversation.id.
我也尝试编码:在conversation.id中。
The code can be see here: https://github.com/Grungnie/microsoftbotframework/blob/FixTeamsError732/microsoftbotframework/response.py in the method reply_to_activity. 代码可以在这里看到: https : //github.com/Grungnie/microsoftbotframework/blob/FixTeamsError732/microsoftbotframework/response.py在方法reply_to_activity中。
The message received from Microsoft (id tags changed slightly) 从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"
}
}
}
Headers 头
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
My Response URL 我的回复网址
https://smba.trafficmanager.net/v3/conversations/a:1lRzVTZeip__5jthfxCqiWX8koXTOg5OsFsnefe2kesHxvJAcJxNJs-TT3NvR1ote1PZZ_DQVkd5u5wsKmw2TQy53bvXOlXydDJjUUcolfphZWu2N-HuX8181rfRIMj7Q/activities/1490615736123
Headers 头
Authorization: Bearer eyJ0eXAgibJ....
Body 身体
{
"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"
}
** Updated after the error code changed on the 29/3. **在29/3上更改了错误代码后更新。 Previous error code below.
以前的错误代码。
{"errorCode":732,"message":""}
So I made a mistake, 所以我弄错了,
response_url = urljoin(self["serviceUrl"], "/v3/conversations/{}/activities/{}".format( conversation_id, reply_to_id))
urljoin is stripping the last part of the url off self["serviceUrl"]. urljoin正在剥离自我[[serviceUrl“]的网址的最后一部分。 This is the expected behaviour.
这是预期的行为。 There doesn't seem to be a method that joins 2 parts of a url together.
似乎没有一种方法可以将URL的两个部分连接在一起。 I wanted to do this as microsoft sometimes sends the url ending with a "/" and sometimes not.
我想这样做,因为微软有时发送以“/”结尾的URL,有时不发送。 I guess I will just write my own method.
我想我会写自己的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.