2017-03-27 16 views
1

從微軟團隊收到消息後發佈到連接器服務時,我在正文中收到404響應。使用Microsoft團隊發佈到Microsoft連接器服務時發生未分類錯誤

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

該服務與Skype一起工作,並與團隊合作,直到大約10天前。

我已經嘗試了ReplyToActivity和RespondToConversation端點。我也試過編碼:在conversation.id中。

代碼可以在這裏看到:https://github.com/Grungnie/microsoftbotframework/blob/FixTeamsError732/microsoftbotframework/response.py在方法reply_to_activity。從微軟收到

消息(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 

我的迴應 URL

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":""} 

回答

0

所以,我犯了一個錯誤,

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

urljoin被剝離的URL的關自[ 「的serviceUrl」]的最後一部分。這是預期的行爲。似乎沒有將URL的2個部分連接在一起的方法。我想這樣做,因爲微軟有時會發送以「/」結尾的URL,有時不會。我想我會寫我自己的方法。

相關問題