我正在尝试回复收到的信息(我相信在这种情况下我不需要发送任何邀请)。
一旦接收到来自“对话”发送方的“消息”资源,我将获取该链接。
<link rel="messaging" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/messaging" /> 然后我建造了一个网址:
url = host + "/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/messaging" + "?OperationId=73dc2a78-2c09-43d3-ade9-166a17845a03";(OperationId I生成)
在我发到那个链接后,我会发一条回复信息。
答复是:
<?xml version="1.0" encoding="utf-8"?>
<reason xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/rtc/2012/03/ucwa">
<code>ServiceFailure</code>
<subcode>None</subcode>
<message>Your request couldn't be completed.</message>
<debugInfo>
<property name="errorReportId">14cb93491da94ab8a638e148462fcc21</property>
</debugInfo>
<parameters />
</reason>My场景:
1)一旦“messagingInvitation”事件到来,我就会“跟随”“接受”链接。2)我收到的包含“会话”资源的事件如下:
<sender rel="conversation" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903">
<updated rel="messaging" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/messaging">
<resource rel="messaging" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/messaging">
<link rel="conversation" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903" />
<link rel="stopMessaging" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/messaging/terminate" />
<property name="state">Connecting</property>
</resource>
</updated>
</sender>3)然后,另一个“事件”到来,相关部分:
<sender rel="communication" href="/ucwa/oauth/v1/applications/103298024370/communication">
<updated rel="conversation" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903">
<resource rel="conversation" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903">
<link rel="applicationSharing" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/applicationSharing" />
<link rel="audioVideo" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/audioVideo" />
<link rel="dataCollaboration" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/dataCollaboration" />
<link rel="messaging" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/messaging" />
<link rel="phoneAudio" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/phoneAudio" />
<link rel="localParticipant" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/participants/XXXXX" title="xxxxxxx" />
<link rel="addParticipant" href="/ucwa/oauth/v1/applications/103298024370/communication/participantInvitations?conversation=81bf5ef8-885f-4579-9add-a5857ccf6903" />
<property name="state">Connected</property>
<property name="threadId">AdKCFu+gFQccG58iQA6mppaTcfoeBwAABC+wAACcbnAAAHuvoAAhdqzwAAv+RhAAAuLo8A==</property>
<property name="subject"></property>
<propertyList name="activeModalities">
<item>Messaging</item>
</propertyList>
<property name="importance">Normal</property>
<property name="recording">False</property>
</resource><property name="state">Connected</property>
这意味着我是有联系的,对吧?
我下一步该做什么?
发布于 2017-02-09 15:32:07
我的场景更新
您确实与对话和消息都有关联。下一步应该是对消息传递资源发出GET请求,或者查找与包含sendMessage链接的消息传递相关的事件。最后,使用该sendMessage链接,您可以向文本/纯文本提供您希望发送的消息。
初始备注
除非有活动的对话,否则您不应该能够回复收到的任何消息。消息资源不是用于响应消息的正确资源。在您的场景中,如果您正在接收来自另一个联系人的消息,并且没有建立会话,那么您将看到包含消息的messagingInvitation。如果这是您的场景,那么所期望的解决方案是检查消息传递资源链接,并在其中找到addMessaging链接和POST,在其中您可以包含一条回复消息。
如果不是这样的情况,请随时提供更多的细节。
https://stackoverflow.com/questions/42139003
复制相似问题