The features specified in this article are available for Live Assist for Microsoft Dynamics365 version 3.0.0. The functionality may not be the same, or even available in a prior release.
Visitor Context Information is available through the Microsoft Dynamics365 CRM Web API. This can be used by Analytics Engines to recover information about engagements.
Important: To use the API and access the chat activity information, from a client which is external to the CRM, you need to authenticate against the API. Code executed from within the Microsoft CRM solution, does not require an explicit authentication step. See: Bot Escalation SDK - Advanced - Chat Activities
See also:
Examples
The following examples show typical usage of the API for accessing chat activity information:
Example 1
Description:
Retrieve chat_activity by ID
Format and Variables:
CrmBaseUrl + /api/data/v8.2/cxlvhlp_chatactivities(CHAT_ACTIVITY_GUID)
Example URI:
https://example99.crmxx.dynamics.com/api/data/v8.2/cxlvhlp_chatactivities(540fc5fc-53d3-e711-a949-002248072cc3)
Example Output:
{"@odata.context":"https://cafexorg.crm11.dynamics.com/api/data/v8.2/$metadata#cxlvhlp_chatactivities/$entity","@odata.etag":"W/\"1219746\"","cxlvhlp_visitoripaddress":"62.172.205.164","cxlvhlp_isp":"BT","_regardingobjectid_value":"6634f32e-4be5-e511-80fe-00155d09ab01","statuscode":2,"cxlvhlp_visitorfirstname":"visitor","cxlvhlp_visitordevice":"DESKTOP","activitytypecode":"cxlvhlp_chatactivity","cxlvhlp_ChatOrigin":100000000,"cxlvhlp_chatstarttime":"2017-11-27T09:18:55Z","createdon":"2017-11-27T09:19:01Z","cxlvhlp_duration":225,"cxlvhlp_IsCustomerInitiatedChat":false,"cxlvhlp_chattranscripturl":"https://service-lab3.labs.liveassistfor365.com/agent/rest/transcript?organization=a58c6374-3af3-48cd-979e-7381cb6a732d&chatsessionid=913607204294967557","isbilled":false,"cxlvhlp_SourcePageURL":"https://service-lab3.labs.liveassistfor365.com/agent-widgets/3.0.0/chat.html?accountId=91360720","subject":"chat with Rodrigo","cxlvhlp_chatsessionid":"913607204294967557","_ownerid_value":"87217364-d1b6-41d7-b748-77020f39c4c8","cxlvhlp_visitorcity":"Cardiff","modifiedon":"2017-11-27T13:03:37Z","cxlvhlp_NumberOfChatTransfers":0,"cxlvhlp_visitoros":"WINDOWS","versionnumber":1219746,"cxlvhlp_IsCustomerAuthenticated":false,"prioritycode":1,"timezoneruleversionnumber":4,"isregularactivity":true,"ismapiprivate":false,"statecode":1,"_modifiedby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_owningbusinessunit_value":"65994fed-d7cb-e711-a8a5-00224801ae66","instancetypecode":0,"cxlvhlp_visitorlanguage":"en-US","leftvoicemail":false,"isworkflowcreated":false,"deliveryprioritycode":1,"cxlvhlp_botescalation":false,"_createdby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","actualend":"2017-11-27T13:03:37Z","cxlvhlp_NumberOfCobrowseSessions":0,"_owninguser_value":"87217364-d1b6-41d7-b748-77020f39c4c8","cxlvhlp_visitorcountry":"United Kingdom","cxlvhlp_chatendtime":"2017-11-27T13:03:16Z","cxlvhlp_AgentClientType":100000000,"cxlvhlp_waittimeinmillis":"4065","activityid":"540fc5fc-53d3-e711-a949-002248072cc3","activityadditionalparams":"{\"context\":{\"agent\":{\"name\":\"Rodrigo\"},\"customer\":{\"id\":{},\"authenticated\":{},\"mobile\":{},\"pageHistory\":[{\"startTime\":1511774331052,\"title\":null,\"url\":\"https://service-lab3.labs.liveassistfor365.com/agent-widgets/3.0.0/chat.html?accountId=91360720\"}],\"browserType\":\"Firefox\",\"browserUserAgent\":\"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0\",\"browserVersion\":\"57.0\",\"city\":\"Cardiff\",\"country\":\"United Kingdom\",\"device\":\"DESKTOP\",\"firstName\":\"visitor\",\"ipAddress\":\"62.172.205.164\",\"isp\":\"BT\",\"language\":\"en-US\",\"os\":\"WINDOWS\"},\"chat\":{\"prechatSurvey\":[],\"agents\":\"\",\"activityId\":\"\",\"conversationId\":\"H1390190442831285070-97715e900b6a4c98a907b04ec359943eK8388869\",\"endTime\":\"\",\"sourceUrl\":\"https://service-lab3.labs.liveassistfor365.com/agent-widgets/3.0.0/chat.html?accountId=91360720\",\"startTime\":1511774335932}}}","lastonholdtime":null,"_owningteam_value":null,"exchangeitemid":null,"seriesid":null,"deliverylastattemptedon":null,"_sendermailboxid_value":null,"scheduledend":null,"description":null,"onholdtime":null,"community":null,"sortdate":null,"_createdonbehalfby_value":null,"_transactioncurrencyid_value":null,"processid":null,"_serviceid_value":null,"_slaid_value":null,"stageid":null,"actualstart":null,"utcconversiontimezonecode":null,"exchangeweblink":null,"scheduleddurationminutes":null,"senton":null,"scheduledstart":null,"_slainvokedid_value":null,"postponeactivityprocessinguntil":null,"_modifiedonbehalfby_value":null,"exchangerate":null,"actualdurationminutes":null,"traversedpath":null,"cxlvhlp_visitoremail":null,"cxlvhlp_skill":null,"cxlvhlp_visitorisp":null,"_cxlvhlp_mobilecontextlookup_value":null,"cxlvhlp_escalatedon":null,"overriddencreatedon":null,"cxlvhlp_channel":null,"cxlvhlp_botname":null,"importsequencenumber":null,"_cxlvhlp_customer_value":null,"_cxlvhlp_browsercontextlookup_value":null}
Example 2
Description:
Retrieve a browser_context related to a specific chat_activity
Format and Variables:
CrmBaseUrl + /api/data/v8.1/cxlvhlp_browsercontexts?$filter=_cxlvhlp_visitorbrowsercontextid_value eq CHAT_ACTIVITY_GUID
Example URI:
https://example99.crmxx.dynamics.com/api/data/v8.1/cxlvhlp_browsercontexts?$filter=_cxlvhlp_visitorbrowsercontextid_value eq 540fc5fc-53d3-e711-a949-002248072cc3
Example Output:
{"@odata.context":"https://cafexorg.crm11.dynamics.com/api/data/v8.1/$metadata#cxlvhlp_browsercontexts","value":[{"@odata.etag":"W/\"1219381\"","versionnumber":1219381,"_owningbusinessunit_value":"65994fed-d7cb-e711-a8a5-00224801ae66","cxlvhlp_useragent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0","_cxlvhlp_visitorbrowsercontextid_value":"540fc5fc-53d3-e711-a949-002248072cc3","cxlvhlp_version":"57.0","statecode":0,"statuscode":1,"_createdby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","cxlvhlp_browsercontextid":"560fc5fc-53d3-e711-a949-002248072cc3","_ownerid_value":"80b33ccc-a6cc-e711-a949-002248014c7d","modifiedon":"2017-11-27T09:19:01Z","_owninguser_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_modifiedby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","cxlvhlp_sourcepageurl":"https://service-lab3.labs.liveassistfor365.com/agent-widgets/3.0.0/chat.html?accountId=91360720","createdon":"2017-11-27T09:19:01Z","cxlvhlp_type":"Firefox","_new_browsercontextlookup2_value":null,"_owningteam_value":null,"_modifiedonbehalfby_value":null,"timezoneruleversionnumber":null,"importsequencenumber":null,"cxlvhlp_name":null,"overriddencreatedon":null,"utcconversiontimezonecode":null,"_createdonbehalfby_value":null}]}
Example 3
Description:
Retrieve all the surveys associated with a chat_activity
Format and Variables:
CrmBaseUrl + /api/data/v8.1/cxlvhlp_surveyitems?$filter=_cxlvhlp_surveyitemsid_value eq CHAT_ACTIVITY_GUID
Example URI:
https://example99.crmxx.dynamics.com/api/data/v8.1/cxlvhlp_surveyitems?$filter=_cxlvhlp_surveyitemsid_value eq f6ea1d46-72cf-e711-a949-00224807251a
Example Output:
{"@odata.context":"https://cafexorg.crm11.dynamics.com/api/data/v8.1/$metadata#cxlvhlp_surveyitems","value":[{"@odata.etag":"W/\"1148795\"","cxlvhlp_question":"What is your name?","_owningbusinessunit_value":"65994fed-d7cb-e711-a8a5-00224801ae66","statecode":0,"cxlvhlp_answer":"Hhj","statuscode":1,"_createdby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_ownerid_value":"80b33ccc-a6cc-e711-a949-002248014c7d","modifiedon":"2017-11-22T10:45:38Z","_owninguser_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_modifiedby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","cxlvhlp_surveyitemid":"f7ea1d46-72cf-e711-a949-00224807251a","versionnumber":1148795,"_cxlvhlp_surveyitemsid_value":"f6ea1d46-72cf-e711-a949-00224807251a","createdon":"2017-11-22T10:45:37Z","cxlvhlp_type":100000000,"_createdonbehalfby_value":null,"timezoneruleversionnumber":null,"_owningteam_value":null,"importsequencenumber":null,"utcconversiontimezonecode":null,"overriddencreatedon":null,"_modifiedonbehalfby_value":null}]}
Example 4
Description:
Retrieve all the surveys with specific question
Format and Variables:
CrmBaseUrl + /api/data/v8.1/cxlvhlp_surveyitems?$filter=cxlvhlp_question eq 'QUESTION'
Example URI:
https://example99.crmxx.dynamics.com/api/data/v8.1/cxlvhlp_surveyitems?$filter=cxlvhlp_question eq 'Overall, how satisfied were you with the service you received on your most recent contact with [insert Company name here]?'
Example Output:
{"@odata.context":"https://cafexorg.crm11.dynamics.com/api/data/v8.1/$metadata#cxlvhlp_surveyitems","value":[{"@odata.etag":"W/\"1219803\"","cxlvhlp_question":"Overall, how satisfied were you with the service you received on your most recent contact with [insert Company name here]?","_owningbusinessunit_value":"65994fed-d7cb-e711-a8a5-00224801ae66","statecode":0,"cxlvhlp_answer":"Very Satisfied","statuscode":1,"_createdby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_ownerid_value":"80b33ccc-a6cc-e711-a949-002248014c7d","modifiedon":"2017-11-27T13:17:46Z","_owninguser_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_modifiedby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","cxlvhlp_surveyitemid":"b542405b-75d3-e711-a94a-002248072781","versionnumber":1219803,"_cxlvhlp_surveyitemsid_value":"839241bc-74d3-e711-a94c-002248072825","createdon":"2017-11-27T13:17:46Z","cxlvhlp_type":100000001,"_createdonbehalfby_value":null,"timezoneruleversionnumber":null,"_owningteam_value":null,"importsequencenumber":null,"utcconversiontimezonecode":null,"overriddencreatedon":null,"_modifiedonbehalfby_value":null},{"@odata.etag":"W/\"1219286\"","cxlvhlp_question":"Overall, how satisfied were you with the service you received on your most recent contact with [insert Company name here]?","_owningbusinessunit_value":"65994fed-d7cb-e711-a8a5-00224801ae66","statecode":0,"cxlvhlp_answer":"Satisfied","statuscode":1,"_createdby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_ownerid_value":"80b33ccc-a6cc-e711-a949-002248014c7d","modifiedon":"2017-11-27T08:21:19Z","_owninguser_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_modifiedby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","cxlvhlp_surveyitemid":"845794f1-4bd3-e711-a949-002248072cc3","versionnumber":1219286,"_cxlvhlp_surveyitemsid_value":"195d7dcc-4bd3-e711-a949-002248072fe8","createdon":"2017-11-27T08:21:19Z","cxlvhlp_type":100000001,"_createdonbehalfby_value":null,"timezoneruleversionnumber":null,"_owningteam_value":null,"importsequencenumber":null,"utcconversiontimezonecode":null,"overriddencreatedon":null,"_modifiedonbehalfby_value":null},{"@odata.etag":"W/\"1219313\"","cxlvhlp_question":"Overall, how satisfied were you with the service you received on your most recent contact with [insert Company name here]?","_owningbusinessunit_value":"65994fed-d7cb-e711-a8a5-00224801ae66","statecode":0,"cxlvhlp_answer":"Satisfied","statuscode":1,"_createdby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_ownerid_value":"80b33ccc-a6cc-e711-a949-002248014c7d","modifiedon":"2017-11-27T08:31:54Z","_owninguser_value":"80b33ccc-a6cc-e711-a949-002248014c7d","_modifiedby_value":"80b33ccc-a6cc-e711-a949-002248014c7d","cxlvhlp_surveyitemid":"74f1366c-4dd3-e711-a949-002248072cc3","versionnumber":1219313,"_cxlvhlp_surveyitemsid_value":"0f3826d1-4cd3-e711-a949-00224807251a","createdon":"2017-11-27T08:31:54Z","cxlvhlp_type":100000001,"_createdonbehalfby_value":null,"timezoneruleversionnumber":null,"_owningteam_value":null,"importsequencenumber":null,"utcconversiontimezonecode":null,"overriddencreatedon":null,"_modifiedonbehalfby_value":null}]}