下载Copilot文字记录和交互数据

客户服务代表(服务代表或代表)使用Copilot的功能,如复制摘要、使用建议回复、反馈和聊天。 Copilot 交互存储在 Dataverse 中的 Copilot 交互(msdyn_copilotinteraction)、Copilot 交互数据(msdyn_copilotinteractiondata)、Copilot 转录(msdyn_copilottranscript) 和 Copilot 转录数据(msdyn_copilottranscriptdata) 表中。 您可以使用Dataverse Web API或.NET的SDK下载文字记录和互动数据。

从2025年8月开始,副驾驶的交互记录存储在 msdyn_copilotevents 表中。 msdyn_copilotinteraction 表和 msdyn_copilotinteractiondata 表包含 8 月之前的记录。

先决条件

  • 确保在 问题和电子邮件的 Copilot 中选中 支持体验数据 复选框,以便系统将事务和交互数据存储在 Dataverse 中。
  • 请确保你已使用全渠道管理员或全渠道主管角色登录。

检索对话摘要

当服务代表使用 Copilot 生成对话摘要时,摘要会存储在 msdyn_conversationinsight Dataverse 的表格中。 表中会创建一条记录,唯一的对话 ID 存储在 msdyn_ConversationId 字段中。 摘要文本存储在 msdyn_copilotsummary 字段中。

例如,在结束与客户的对话后,服务代表使用 Copilot 生成对话摘要。 对话摘要存储在 msdyn_conversationinsight 表中,取值如下。

Attribute 示例值
会话 ID 70b76ab52-120b-49e6-9dce-53f235125a01
对话摘要 “问题:咖啡机的冲泡阀门出了问题。 排查步骤:客户报告了这个问题。 结果:该问题已上报以获取进一步协助。

您可以按以下方式获取对话摘要:

  1. 识别对话ID,即表中 msdyn_ocliveworkitem 记录的主要标识符。 在我们的例子中,这个值是70b76ab52-120b-49e6-9dce-53f235125a01。

  2. 请使用以下Web API请求来过滤 msdyn_conversationinsight 表记录。

    
     [Organization URI]/api/data/v9.2/msdyn_conversationinsights?$filter=_msdyn_conversationid_value eq '<conversation-ID>'
    
    

    在我们的例子中,Web API 请求如下。

     https://<yourorg>.crm.dynamics.com/api/data/v9.2/msdyn_conversationinsights?$filter=_msdyn_conversationid_value eq '70b76ab52-120b-496e-9dce-53f235125a01'
    

    我们示例的样本响应如下:

    {
    "status": { "code": 20000, "message": "Successfully fetched summary from insights" },
    "summary": "Issue: Trouble with the brew valve on the coffee machine.\nTroubleshooting steps: \n- Customer reported the issue.\nOutcome: Issue reported for further assistance."
    }
    

我的副驾驶互动记录在哪里

每次服务代表与 Copilot 的交互都会以唯一的交互 ID 存储在 msdyn_copilotinteraction 或 msdyn_copilotevents 表中。 下表列出了每种交互类型对应的交互数据存储位置。

Feature Table
提出问题 msdyn_copilottranscriptdata
反馈、案件摘要、写邮件、建议回复 msdyn_copilotinteractiondata、msdyn_copilotevents

注意

Copilot交互记录自2025年8月起存储在msdyn_copilotevents表格中。 8月之前的记录存储在 msdyn_copilotinteraction 和 msdyn_copilotinteractiondata 表格中。

从副驾驶互动记录中获取msdyn_copilotinteractionid和msdyn_interactiondataid

在执行下载文字记录或查看逐字反馈等操作之前,您必须从 msdyn_copilotinteraction 中检索 msdyn_copilotinteractionid 的值以及对应的 msdyn_copilotinteractiondata 记录 ID 值。 您可以使用以下 Web API 调用,在 msdyn_copilotinteractionid 字段中获取 interaction ID,并在 msdyn_interactiondataid_value 字段中获取 interactiondataid。

[Organization URI]/api/data/v9.1/msdyn_copilotinteractions
Accept: application/json  
OData-MaxVersion: 4.0  
OData-Version: 4.0  

从副驾驶事件记录中获取msdyn_copilotinteractionid

在下载文字稿或查看逐字反馈之前,您必须从表格中获取 的msdyn_copilotinteractionidmsdyn_copilotevents值。 您可以使用以下 Web API 调用来获取字段中的 msdyn_copilotinteractionid 交互 ID。

[Organization URI]/api/data/v9.2/msdyn_copilotevents
Accept: application/json  
OData-MaxVersion: 4.0  
OData-Version: 4.0  

密钥属性

记录中的关键属性如下。

Attribute 定义
msdyn_copilotinteractionid 实体实例的唯一标识符
msdyn_scenariorequestid 将多个相关的 Copilot 交互归为一组。
例如:客服代表向 Copilot 提出一个问题,然后给收到的回答点了个赞。 它们被视为两种相互作用,但实际上属于同一场景。
msdyn_scenariotype 指代表所使用的特征。
msdyn_interactiontype 指的是与Copilot的具体代表性互动。
msdyn_interactionforid 代表与 Copilot 交互时所引用记录的实体 ID。
msdyn_interactionforlogicalname 代表与 Copilot 交互过的引用记录的实体逻辑名称。
msdyn_interactioncontext 补充背景,比如对文字记录的引用。
msdyn_interactiondataid 指包含交互数据的 msdyn_copilotinteractiondata 实体

示例响应

以下回答表示一个场景:代表向Copilot提问,然后选择拇指向下按钮以提供反馈。 对于这两种交互,msdyn_scenariorequestid、msdyn_scenariotype是相同的。 msdyn_interactiontype交互的值设置为100230305和100230302,分别对应生成和否定。


{
          "@odata.etag": "W/\"17413914\"",
          "msdyn_interactiontype": 100230305,
          "msdyn_clienttimestamp": "2025-03-19T08:00:34Z",
          "modifiedon": "2025-03-19T08:00:34Z",
          "msdyn_interactionforlogicalname": "msdyn_ocliveworkitem",
          "overriddencreatedon": null,
          "msdyn_scenariotype": 100230201,
          "importsequencenumber": null,
          "_modifiedonbehalfby_value": null,
          "msdyn_interactionforid": "2cc5ea06-a4fd-4f83-8e75-0324383b953f",
          "statecode": 0,
          "msdyn_scenariorequestid": "cbdc1bef-6099-7f9a-f1fe-dab02e36315b",
          "_organizationid_value": "7eede269-bbb1-ef11-8a64-000d3a350e1a",
          "versionnumber": 17413914,
          "utcconversiontimezonecode": 190,
          "_msdyn_interactiondataid_value": null,
          "_createdonbehalfby_value": null,
          "_modifiedby_value": "864a96d6-6bb0-ef11-a730-000d3a59065a",
          "createdon": "2025-03-19T08:00:34Z",
          "msdyn_interactioncontext": "{\"OcSessionId\":\"28dea393-c175-4788-9494-07fd42ee0884\",\"ResponseStatusCode\":20000,\"Plugins\":{\"IsContentRedacted\":false},\"Transcript\":{\"Id\":\"8d1d70e6-3297-644a-4e86-00d8973223a0\",\"DataId\":\"a1584aaf-d5bd-357d-54a8-84dbdba547f9\"},\"Filters\":{\"AgentContextFilters\":[],\"AutomatedFilters\":[]},\"Streaming\":{\"State\":\"GENERATED\"},\"ResponseSource\":{\"category\":\"KnowledgeSearch\",\"subCategory\":\"KnowledgeSearch\"},\"IsAutoPrompt\":true,\"AutoPromptTrigger\":\"follow-up-prompt\",\"IsAutoExpanded\":false,\"IsSuggestedPrompt\":false,\"IsEmbed\":false,\"IsStandalone\":false}",
          "msdyn_name": null,
          "statuscode": 1,
          "msdyn_copilotinteractionid": "c49dc43b-9804-f011-bae2-6045bd014292",
          "_createdby_value": "864a96d6-6bb0-ef11-a730-000d3a59065a",
          "timezoneruleversionnumber": 0
      },
      {
          "@odata.etag": "W/\"17413983\"",
          "msdyn_interactiontype": 100230302,
          "msdyn_clienttimestamp": "2025-03-19T08:00:37Z",
          "modifiedon": "2025-03-19T08:00:41Z",
          "msdyn_interactionforlogicalname": "msdyn_ocliveworkitem",
          "overriddencreatedon": null,
          "msdyn_scenariotype": 100230201,
          "importsequencenumber": null,
          "_modifiedonbehalfby_value": null,
          "msdyn_interactionforid": "2cc5ea06-a4fd-4f83-8e75-0324383b953f",
          "statecode": 0,
          "msdyn_scenariorequestid": "cbdc1bef-6099-7f9a-f1fe-dab02e36315b",
          "_organizationid_value": "7eede269-bbb1-ef11-8a64-000d3a350e1a",
          "versionnumber": 17413983,
          "utcconversiontimezonecode": 190,
          "_msdyn_interactiondataid_value": null,
          "_createdonbehalfby_value": null,
          "_modifiedby_value": "864a96d6-6bb0-ef11-a730-000d3a59065a",
          "createdon": "2025-03-19T08:00:41Z",
          "msdyn_interactioncontext": "{\"OcSessionId\":\"28dea393-c175-4788-9494-07fd42ee0884\",\"IsEmbed\":false,\"IsStandalone\":false}",
          "msdyn_name": null,
          "statuscode": 1,
          "msdyn_copilotinteractionid": "cb9dc43b-9804-f011-bae2-6045bd014292",
          "_createdby_value": "864a96d6-6bb0-ef11-a730-000d3a59065a",
          "timezoneruleversionnumber": 0
      },

下载聊天记录

当服务代表向 Copilot 提问时,聊天记录会被保存为转录,使用 Dataverse 表格中的 UTF-16LE 字符集msdyn_copilottranscriptdata,以 base64 编码格式编码。 您可以下载文字记录,查看Copilot提供的对话和回复。

例如,在处理一个案件时,服务代表问Copilot“我如何预订行程?”。 Copilot 会根据知识库文章生成回复。 如果您想下载聊天记录,请执行以下步骤:

  1. 使用网页API调用获取 交互ID。

  2. 用所需的交互ID过滤msdyn_copilotinteraction表,以获取 Transcript.DataID from msdyn_interactioncontext 属性。 请使用以下Web API请求按交互ID过滤数据。

    
       [Organization URI]/api/data/v9.1/msdyn_copilotinteractions(<msdyn_copilotinteractionid>)
       Accept: application/json  
       OData-MaxVersion: 4.0  
       OData-Version: 4.0  
    
    Attribute 我们情景的价值
    msdyn_copilotinteractionid F0970641-C1E7-EE11-904C-000D3A3BB867
    msdyn_scenariorequestid 93893746-e203-e9b6-18b9-887d68d18daf
    msdyn_scenariotype 提出问题
    msdyn_interactiontypename 已生成
    msdyn_interactionforid 1cd6023d-d326-ee11-9966-000d3A3411CF(相互作用的起始案例)
    msdyn_interactioncontext {\"OcSessionId\":\"28dea393-c175-4788-9494-07fd42ee0884\",\"ResponseStatusCode\":20000,\"Plugins\":{\"IsContentRedacted\":false},\"Transcript\":{\"Id\":\"8d1d70e6-3297-644a-4e86-00d8973223a0\",\"DataId\":\"a1584aaf-d5bd-357d-54a8-84dbdba547f9\"},\"Filters\":{\"AgentContextFilters\":[],\"AutomatedFilters\":[]},\"Streaming\":{\"State\":\"GENERATED\"},\"ResponseSource\":{\"category\":\"KnowledgeSearch\",\"subCategory\":\"KnowledgeSearch\"},\"IsAutoPrompt\":true,\"AutoPromptTrigger\":\"follow-up-prompt\",\"IsAutoExpanded\":false,\"IsSuggestedPrompt\":false,\"IsEmbed\":false,\"IsStandalone\":false}
  3. 从msdyn_interactioncontext复制Trasncript.DataId的值。 在我们的例子中,这个值是 a1584aaf-d5bd-357d-54a8-84dbdba547f9。

  4. 以下Web API请求将以base64/UTF-16LE格式检索编码的文字稿。

      [Organization URI]/api/data/v9.1/msdyn_copilottranscriptdatas(<Transcript:DataID>)/msdyn_transcriptdata
      Accept: application/json  
      OData-MaxVersion: 4.0  
      OData-Version: 4.0  
    

    在我们的例子中,Web API 请求如下。

     [Organization URI]/api/data/v9.1/msdyn_copilottranscriptdatas(a1584aaf-d5bd-357d-54a8-84dbdba547f9)/msdyn_transcriptdata
    
  5. 使用带有UTF-16LE字符集选项的base64解码器解码编码数据,以获取转录本。 你可以使用在线解码工具来解码数据。 以我们的例子为例,解码后的转录图如下所示。

    
    {
      "messages": [
        {
          "id": "283c2269-b131-dac2-3aed-847bd99402e7",
          "requestId": "93893746-e203-e9b6-18b9-887d68d18daf",
          "message": "How can I book a trip?",
          "sequence": 0,
          "user": "user",
          "timestamp": 1711052758750,
          "isActivityError": false,
          "context": {}
        },
        {
          "id": "eba9e9d5-71e2-9502-0bca-9387246fb094",
          "requestId": "93893746-e203-e9b6-18b9-887d68d18daf",
          "message": "To book a trip, follow these steps:\n\n1. Go to the travel portal.\n2. Click on \"Travel\" and then select \"Book a Trip\".\n3. Fill in your name, contact information, and the dates of your trip.\n4. Choose your destination from the drop-down menu. Here's the data you'll be working with:\n\n```json\n{\n    \"id\": \"11bb11bb-cc22-dd33-ee44-55ff55ff55ff\",\n    \"title\": \"Booking Travel\",\n    \"source\": \"internal_kb\"\n}\n```\n\n5. Select a hotel from the drop-down menu and specify the check-in and check-out dates. If you don't want to book a hotel, you can check the \"I do not want to book a hotel\" box.\n6. Choose the type of rental car you want. If you don't want to rent a car, you can check the \"I do not want to rent a car\" box.\n7. Click \"Submit\".\n\nOnce you've submitted your booking request, you will receive a follow-up communication from a representative with a quote. You can also add any notes or additional information by clicking on the case from the My Bookings screen.",
          "sequence": 1,
          "user": "bot",
          "timestamp": 1711052776968,
          "isActivityError": false,
          "sources": [
            {
              "id": "11bb11bb-cc22-dd33-ee44-55ff55ff55ff",
              "title": "Booking Travel",
              "source": "internal_kb"
            }
          ],
          "context": {
            "customerIntent": "How to book a trip?"
          }
        }
      ],
      "context": {
        "chatId": "21b27e83-299d-a639-3e4a-8dcd6332e184",
        "sessionId": "session-id-2",
        "entityId": "11bb11bb-cc22-dd33-ee44-55ff55ff55ff",
        "entityName": "knowledgearticle"
      }
    } 
    
    

检索逐字反馈

当代表与Copilot互动时,可以对Copilot提供的回答提供反馈。 反馈存储在 Dataverse 中 msdyn_copilotinteractiondata 表的 msdyn_verbatim 列中。

例如,Copilot的回答不准确,客服代表选择了竖起的大拇指图标来提供反馈。 客服代表还会逐字反馈。 应用程序在 msdyn_copilotinteraction 表中创建一条记录,并将 msdyn_interactiontypename 设置为 ThumbsDown。

该记录的关键属性如下。

Attribute 用于我们示例的样本数据
msdyn_copilotinteractionid 817ff9e4-cbe7-ee11-904c-000d3a3bb867
msdyn_scenariorequestid 93893746-e203-e9b6-18b9-887d68d18daf
msdyn_scenariotype 提出问题
msdyn_interactiontype 100230302
msdyn_interactiontypename 大拇指向下
msdyn_interactionforid 1cd6023d-d326-ee11-9966-000d3a3411cf
msdyn_interactiondataid 807ff9e4-cbe7-ee11-904c-000d3a3bb867
partitionid 20250622-20250628-100230203

注意

仅当你使用 msdyn_copilotevents 表时,PartitionID 才适用。

你可以按照以下方式获得代表提供的逐字反馈。

  1. 从msdyn_copilotinteraction表中获取所需的 msdyn_copilotinteractiondata 记录 ID 值。

注意

如果您使用的是 msdyn_copilotevents 表格,请跳过此步骤。 msdyn_copilotinteractiondataid已在msdyn_copilotevents表中提供。

  1. 运行以下 Web API 请求以获取逐字反馈。

    如果你使用 msdyn_copilotevents 表,请使用以下内容:

    [Organization URI]/api/data/v9.1/msdyn_copilotevents(msdyn_copiloteventid=<GUID>,partitionid='<partitionId>')
    

    在我们的例子中,Web API 请求如下:

    [Organization URI]/api/data/v9.2/msdyn_copilotevents(msdyn_copiloteventid=f9d841e5-34e7-ee11-904c-000d3a3bb867,partitionid='20250622-20250628-100230203')
    
  2. 在 msdyn_verbatim 列中查看可用的原文反馈。 以我们的例子为例,检索的反馈如下。

    
      {
      "@odata.etag": "W/\"29538313\"",
      "_owningbusinessunit_value": "0e9ec0a2-eb6a-ed11-9561-000d3a336228",
      "statecode": 0,
      "statuscode": 1,
      "_createdby_value": "586cb7a8-eb6a-ed11-9561-000d3a336228",
      "msdyn_copilotinteractiondataid": "807ff9e4-cbe7-ee11-904c-000d3a3bb867",
      "_ownerid_value": "586cb7a8-eb6a-ed11-9561-000d3a336228",
      "modifiedon": "2024-03-21T21:42:21Z",
      "msdyn_verbatim": "Article is outdated",
      "_owninguser_value": "586cb7a8-eb6a-ed11-9561-000d3a336228",
      "_modifiedby_value": "586cb7a8-eb6a-ed11-9561-000d3a336228",
      "versionnumber": 29538313,
      "createdon": "2024-03-21T21:42:21Z",
      "msdyn_interactiondata_name": null,
      "overriddencreatedon": null,
       "importsequencenumber": null,
      "_modifiedonbehalfby_value": null,
      "msdyn_interactiondata": null,
      "utcconversiontimezonecode": null,
      "_createdonbehalfby_value": null,
      "msdyn_name": null,
      "_owningteam_value": null,
      "timezoneruleversionnumber": null
    }
    
    

下载交互数据

除“提问”转录记录外,客服代表与 Copilot 之间的所有其他交互数据都存储在 Dataverse 中的 msdyn_copilotinteractiondata 或 msdyn_copilotevents 表中。

例如,一次交互可以是代表使用 Copilot 生成电子邮件或案件摘要。 我们例子的关键属性如下。

Attribute 我们情景的价值
msdyn_copilotinteractionid 0dd941e5-34e7-ee11-904c-000d3a3bb867
msdyn_scenariorequestid 42ae7f8e-736f-1cea-035b-6bf970b48e9c
msdyn_scenariotype 案例摘要
msdyn_interactiontype 100230305
msdyn_interactiontypename 已生成
msdyn_interactionforid 1cd6023d-d326-ee11-9966-000d3a3411cf
msdyn_interactioncontext {"Filters":{"AgentContextFilters":[],"DynamicFilters":{"IsApplied":false}}}
msdyn_interactiondataid f9d841e5-34e7-ee11-904c-000d3a3bb867

你可以按以下方式下载交互数据。

  1. 从 msdyn_copilotinteraction 表中获取所需的 msdyn_copilotinteractiondata 记录 ID 值。

注意

如果你使用的是 msdyn_copilotevents 表,请跳过此步骤。 msdyn_copilotinteractiondataid 已在 msdyn_copilotevents 表中提供。

  1. 运行以下 Web API 请求以 base64 编码格式检索交互数据:

    如果你用的是msdyn_copilotevents表,请使用以下方法:

    <org-url>/api/data/v9.2/msdyn_copilotevents(msdyn_copiloteventid=<GUID>,partitionid='<partitionId>')/msdyn_interactiondata/$value 
    

    在我们的例子中,Web API 请求如下:

    <org-url>/api/data/v9.2/msdyn_copilotevents(msdyn_copiloteventid=f9d841e5-34e7-ee11-904c-000d3a3bb867,partitionid='20250622-20250628-100230203')/msdyn_interactiondata/$value 
    

  1. 解码base64编码数据以获取转录记录。 你可以使用在线的base64解码工具来解码数据。 以我们的电子邮件为例,解码后的交互数据显示如下。

注意

“提出问题”、“建议回复”和“起草电子邮件”功能使用采用 UTF-16LE 字符集的 Base64 编码器。 案件和对话摘要使用UTF-8字符集。 我们建议您使用用于编码数据的相同字符集来解码数据。

解码后的交互数据截图。

使用 Copilot 解决客户问题
查看 Copilot 分析报告