我试图用UCWA为商业聊天机器人编写Skype代码。现在,我可以成功地创建一个应用程序,发送一个消息邀请,最后发送一个正确接收的消息。问题是:如果我发送另一条信息,它永远不会被它的接收者接收。
在这种情况下,消息状态是“失败”,但没有提供其他有用的信息。
我使用了马修·普罗克托教程和官方的Microsoft文档。Microsoft示例在结束对话之前只发送一条消息,因此没有给出有关我的问题的指示。Matthew的教程只说要重新运行POST请求POST https://myhostname.com/ucwa/oauth/v1/applications/108/communication/conversations/39e/messaging/messages。我正确地调用了每个消息之间的事件资源。
下面是在我的脚本中执行的步骤:
sd.send_user_message_invitation()
conv_id = sd.get_conversation_ID_in_event()
sd.send_message(conv_id, "Premier message")
sd.get_event()
sd.send_message(conv_id, "Deuxième message")
sd.get_event()
sd.terminate_conversation(conv_id)下面是在第一条消息(正确地接收到)之后对事件URL发出get请求时所得到的响应:
GET https://myhostname.com/ucwa/oauth/v1/applications/108/events?ack=2
{
"_links": {
"self": {"href": "/ucwa/oauth/v1/applications/108/events?ack=2"},
"next": {"href": "/ucwa/oauth/v1/applications/108/events?ack=3"}
},
"sender": [
{
"rel": "conversation",
"href": "/ucwa/oauth/v1/applications/108/communication/conversations/39e",
"events": [
{
"link": {
"rel": "message",
"href": "/ucwa/oauth/v1/applications/108/communication/conversations/39e/messaging/messages/2"
},
"status": "Success",
"_embedded": {
"message": {
"direction": "Outgoing",
"timeStamp": "\/Date(1581608086884)\/",
"_links": {
"self": {"href": "/ucwa/oauth/v1/applications/108/communication/conversations/39e/messaging/messages/2"},
"messaging": {"href": "/ucwa/oauth/v1/applications/108/communication/conversations/39e/messaging"}
},
"rel": "message"
}
},
"type": "completed"
}
]
}
]
}下面是在第二条消息(或后续发送的)消息(未接收到)之后对事件URL发出get请求时所得到的信息:
GET https://myhostname.com/ucwa/oauth/v1/applications/108/events?ack=3
{
"_links": {
"self": {"href": "/ucwa/oauth/v1/applications/108/events?ack=3"},
"next": {"href": "/ucwa/oauth/v1/applications/108/events?ack=4"}
},
"sender": [
{
"rel": "conversation",
"href": "/ucwa/oauth/v1/applications/108/communication/conversations/39e",
"events": [
{
"link": {
"rel": "message",
"href": "/ucwa/oauth/v1/applications/108/communication/conversations/39e/messaging/messages/3"
},
"status": "Failure",
"_embedded": {
"message": {
"direction": "Outgoing",
"timeStamp": "\/Date(1581608088182)\/",
"_links": {
"self": {"href": "/ucwa/oauth/v1/applications/108/communication/conversations/39e/messaging/messages/3"},
"messaging": {"href": "/ucwa/oauth/v1/applications/108/communication/conversations/39e/messaging"}
},
"rel": "message"
}
},
"reason": {
"code": "RemoteFailure",
"message": "Your request couldn\u0027t be completed.",
"debugInfo": {"errorReportId": "fb8aada02f7f47e6958b6c7df62e7bec"}
},
"type": "completed"
}
]
}
]
}我忘了什么?有什么帮助吗?
发布于 2020-03-06 14:11:24
我刚解决了问题。似乎存在编码错误,因此不能发送包含重音字符的消息("é“、"è”、"à“、”a“、.)不会导致失败。
https://stackoverflow.com/questions/60213647
复制相似问题