sendMessageToConversation

Customer Service 全渠道提供了一套功能,扩展了 Dynamics 365 Customer Service Enterprise 的能力,使组织能够通过数字消息传递渠道与客户即时联系和互动。 访问 Customer Service 全渠道需要额外的许可证。 有关详细信息,请参见 Dynamics 365 Customer Service 定价概述和 Dynamics 365 Customer Service 定价计划页面。

使用此方法向对话发送消息。

注释

Syntax

Microsoft.Omnichannel.sendMessageToConversation(message, toSendBox, conversationId);

参数

参数 类型 Description
消息 String 或 MessageObject 指示要发送到对话的消息。
*发送框 布尔 确定是将消息发送到 sendBox 还是直接发送到对话。 如果不提供此参数,则默认情况下将消息发送到 sendbox。
*conversationId String 要将消息发送到的对话的唯一标识符。 也称为 liveworkitemId。 如果不提供此参数,消息将默认发送到焦点对话。

* 指示可选参数。

返回值

根据作的结果返回已解决或拒绝的 Promise。

Example

// Sending message directly to the chat of conversation with provided conversationId
Microsoft.Omnichannel.sendMessageToConversation("Test message",  false, "eeeeeeee-4444-5555-6666-ffffffffffff");
// Sending valid rich object to conversation
let validRichObjJSON = {
  "survey": {
    "Answers": {
      "Section": [
        {
          "Listitems": [
            {
              "OptionTitle": "Xbox Controller multi color",
              "OptionDescription": "Xbox Controller multi color",
              "OptionImageURL": "https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RWwBPt?ver=d74f&w=270&h=222&q=90&m=6&p=48&b=%23FFFFFFFF&f=png&o=f&aim=true"
            }
          ],
          "SectionTitle": "XBox Controllers",
          "Multiselect": true
        }
      ],
      "Title": "Microsoft Xbox Controllers",
      "subtitle": "Choose a controller you like",
      "ImageURL": "https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE2XP73?ver=7371&w=270&h=222&q=90&m=6&p=48&b=%23FFFFFFFF&f=png&o=f&aim=true",
      "ResponseMessage": "Thanks for choosing."
    }
  },
  "richObjectId": "eeeeeeee-4444-5555-6666-ffffffffffff",
  "richObjectType": 192350002,
  "richObjectName": "Test with 0 guid",
  "tabKey": ""
}

Microsoft.Omnichannel.sendMessageToConversation(validRichObjJSON,  false);

实时聊天 SDK 参考
全渠道 JavaScript API 参考
开放对话
getConversationId
链接到对话
取消链接从对话
获取对话