다음을 통해 공유


Dynamics 365 Contact Center 대화 내용을 대량으로 다운로드

Dynamics 365 Contact Center 대화 내용은 Microsoft Dataverse의 주석 테이블에 base64 인코딩 형식으로 저장됩니다. 첨부 파일은 주석 테이블에 별도의 레코드로 저장됩니다. 대화에 상담원과 고객 간에 교환된 두 개의 파일이 있는 경우 이 대화와 관련하여 총 3개의 레코드가 생성됩니다. 모든 대화에는 주석 테이블에 항상 n+1개의 레코드가 저장되어 있으며, 여기서 n은 대화의 첨부 파일 수입니다. 첨부 파일도 저장되기 전에 base64로 인코딩됩니다.

대본을 대량으로 다운로드하는 옵션은 기본적으로 사용할 수 없습니다. 다음 Web API 요청을 사용하여 지난 한 달 동안 교환된 모든 대본 및 첨부 파일을 검색할 수 있습니다.

다음 Web API 요청은 모든 텍스트 대본을 검색합니다.

GET [Organization URI]/api/data/v9.1/annotations?$filter=objecttypecode eq 'msdyn_transcript'
Accept: application/json  
OData-MaxVersion: 4.0  
OData-Version: 4.0  

다음 Web API 요청은 모든 첨부 파일 주석을 검색합니다.

GET [Organization URI]/api/data/v9.1/annotations?$filter=objecttypecode eq 'msdyn_ocliveworkitem'
Accept: application/json  
OData-MaxVersion: 4.0  
OData-Version: 4.0  

각 웹 API 요청에서 가져온 응답의 특성에는 documentBody base64로 인코딩된 대본 또는 첨부 파일이 포함됩니다.

C# 코드를 사용하여 API를 호출한 다음, 반환된 각 레코드를 반복하고, 특성에 documentBody 액세스하고, 처리하여 전체 대본을 가져올 수 있습니다.

대화 내용을 생성하려면 고객이 보낸 메시지가 하나 이상 필요합니다.

JSON 성적표의 구조

링크에 표시되는 대화 내용에는 다양한 유형의 메시지가 포함될 수 있습니다.

  • 제어 메시지
  • 시스템 메시지
  • 문자 메시지(예: 안녕하세요, 안녕하세요, 안녕하세요)
  • 첨부 파일 메타데이터

이러한 각 유형의 메시지에서 이 메시지가 게시되거나 생성된 정확한 시간을 나타내는 필드를 볼 createdDateTime 수 있습니다.

제어 메시지는 시각적 가치가 없으며 상담원이 대화에 참여하거나 떠난 것과 같은 이벤트를 나타냅니다. 일반적으로 set to 라는 플래그 isControlMessage 가 있습니다.true

{
    "content": "<addmember><eventtime>1589863236124</eventtime><initiator>28:bc81db89-c4d7-4763-91fe-086fcc2e6daf</initiator><rosterVersion>1589863235629</rosterVersion><lastRosterVersion>1589801089959</lastRosterVersion><target>8:orgid:04fd615d-586d-4866-9791-b24c5f7a9e78</target></addmember>",
    "contentType": "text",
    "createdDateTime": "2020-05-19T04:40:36.124+00:00",
    "likes": [],
    "attachments": [],
    "id": "1589863236124",
    "created": "2020-05-19T04:40:36.124Z",
    "culture": null,
    "deleted": null,
    "important": null,
    "modified": null,
    "modifiedDateTime": null,
    "isControlMessage": true,
    "from": null
},

시스템 메시지는 대화 중 이벤트와 관련하여 고객에게 표시되는 특수한 유형의 메시지입니다. 예를 들어 상담원이 참여할 때, 상담원이 연결을 끊을 때, 새 상담원이 참여할 때가 있습니다.

{
	"content": "Alan Steiner has left the conversation.",
	"contentType": "text",
	"createdDateTime": "2020-05-19T04:43:12.976+00:00",
	"from": {
		"application": {
			"displayName": "DynamicsBot",
			"id": "bc81db89-c4d7-4763-91fe-086fcc2e6daf"
		},
		"user": null,
		"phone": null,
		"guest": null,
		"encrypted": null,
		"onPremises": null,
		"azureApplicationInstance": null,
		"applicationInstance": null,
		"device": null
	},
	"likes": [],
	"attachments": [],
	"id": "1589863392976",
	"created": "2020-05-19T04:43:12.976Z",
	"culture": null,
	"deleted": null,
	"important": null,
	"modified": null,
	"modifiedDateTime": null,
	"tags": "system"
},

상담원과 고객 간의 채팅 중에 교환되는 문자 메시지는 다음과 같이 표시됩니다.

{
	"content": "I am using product A",
	"contentType": "text",
	"createdDateTime": "2020-05-19T04:43:03.979+00:00",
	"from": {
		"user": {
			"displayName": "Customer",
			"id": "04fd615d-586d-4866-9791-b24c5f7a9e78"
		},
		"phone": null,
		"guest": null,
		"encrypted": null,
		"onPremises": null,
		"azureApplicationInstance": null,
		"applicationInstance": null,
		"application": null,
		"device": null
	},
	"likes": [],
	"attachments": [],
	"id": "1589863384036",
	"created": "2020-05-19T04:43:03.979Z",
	"culture": null,
	"deleted": null,
	"important": null,
	"modified": null,
	"modifiedDateTime": null,
	"tags": "private,parentID-5493180821148088016",
	"deliveryMode": "unbridged"
},

앞의 코드에서 볼 수 있듯이 고객이 보낸 메시지의 표시 이름은 식별되지 않은 고객인 경우 "고객"이고 Dynamics 365 Contact Center에 알려진 경우 실제 이름입니다.

상담원이 고객에게 보내는 메시지의 경우 "공개" 메시지임을 나타내는 태그가 있습니다. 태그에 "비공개"로 표시된 메시지는 두 상담원 간에 교환되는 메시지이며 고객에게 표시되지 않습니다.

{
	"content": "Great! Just give me a moment. \\nWhich product are you using currently?",
	"contentType": "text",
	"createdDateTime": "2020-05-19T04:42:44.202+00:00",
	"from": {
		"user": {
			"displayName": "Alan Steiner",
			"id": "04fd615d-586d-4866-9791-b24c5f7a9e78"
		},
		"phone": null,
		"guest": null,
		"encrypted": null,
		"onPremises": null,
		"azureApplicationInstance": null,
		"applicationInstance": null,
		"application": null,
		"device": null
	},
	"likes": [],
	"attachments": [],
	"id": "1589863364220",
	"created": "2020-05-19T04:42:44.202Z",
	"culture": null,
	"deleted": null,
	"important": null,
	"modified": null,
	"modifiedDateTime": null,
	"tags": "public,messageId-1589863364202,RTT-C1",
	"deliveryMode": "unbridged"
},

메시지는 FileAttachment JSON에서 다음 코드 조각과 같습니다.

{
    "content": "",
    "contentType": "text",
    "createdDateTime": "2020-05-06T21:31:37.316+00:00",
    "from": {
      "application": {
        "displayName": "Customer",
        "id": "6cc05310-05d9-4ce5-8fc0-d606c478f896"
      },
      "user": null,
      "phone": null,
      "guest": null,
      "encrypted": null,
      "onPremises": null,
      "azureApplicationInstance": null,
      "applicationInstance": null,
      "device": null
    },
    "likes": [
    ],
    "attachments": [
      {
        "id": "0-wus-d3-37f4fa3cd63945c526799ae5b4e009f5",
        "index": 0,
        "fileType": "docx",
        "name": "mr Hand goes to the moon, By contoso.docx",
        "sourceUrl": "https://us-api.asm.contoso.com/v1/objects/0-wus-d3-37f4fa3cd63945c526799ae5b4e009f5/",
        "annotationid": "cfb551a8-ef4f-431a-871f-9b027ff940e3"
      }
    ],
    "id": "1588800697316",
    "created": "2020-05-06T21:31:37.316Z",
    "culture": null,
    "deleted": null,
    "important": null,
    "modified": null,
    "modifiedDateTime": null,
    "deliveryMode": "bridged"
  },

일반적으로 채팅 중에 교환된 첨부 파일과 관련된 메타데이터가 있습니다. 는 annotationid 해당 첨부 파일에 대한 주석 테이블의 base64 인코딩 레코드에 대한 키입니다. 다음 Web API 요청을 사용하여 레코드를 검색할 수 있습니다. Web API 요청은 원하는 방식으로 디코딩하고 사용할 수 있는 base64로 인코딩된 첨부 파일을 제공합니다.

GET [Organization URI]/api/data/v9.1/annotations(<annotationid>)
Accept: application/json  
OData-MaxVersion: 4.0  
OData-Version: 4.0  

개발자를 위한 Dynamics 365 Contact Center