UCWA 回复传入消息

UCWA replying to incoming message

我正在尝试回复收到的消息(我相信在这种情况下我不需要发送任何邀请)。

收到来自 'conversation' 发件人的 'message' 资源后,我将 link

<link rel="messaging" href="/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/messaging" /> 

然后我构造了一个url:

url = host + "/ucwa/oauth/v1/applications/103298024370/communication/conversations/81bf5ef8-885f-4579-9add-a5857ccf6903/messaging" + "?OperationId=73dc2a78-2c09-43d3-ade9-166a17845a03";

(我生成的OperationId)

然后我 POST 回复了那个 link 消息。

回复是:

<?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>

我的场景:

1)一旦'messagingInvitation'事件到来,我'follow''accept'link。 2) 我收到的以下事件包含 'conversation' 资源:

<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) 然后,又一个'event'到了,相关部分:

<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>

所以这意味着我已连接,对吗?

下一步应该做什么?

我的场景更新

您确实已连接到对话和消息。 您的下一步应该是对消息资源发出 GET 请求,或者查找与包含 link 到 sendMessage 的消息相关的事件。最后,使用该 sendMessage link,您可以提供一个 text/plain 正文,其中包含您要发送的消息。

初始笔记

除非正在进行对话,否则您应该无法回复任何收到的消息。 messaging resource is not the correct resource to use to respond to messages. In your scenario if you are receiving a message from another contact and have not established a conversation you would be looking at a messagingInvitation that included a message. If this is your scenario the intended solution is to inspect the messaging resources links and locate addMessaging link 和 POST 上的 messaging resource is not the correct resource to use to respond to messages. In your scenario if you are receiving a message from another contact and have not established a conversation you would be looking at a messagingInvitation that included a message. If this is your scenario the intended solution is to inspect the messaging resources links and locate addMessaging link 可以添加回复消息。

如果不是这种情况,请随时提供更多详细信息。