Professional Documents
Culture Documents
LIVEENGAGE
ENGAGEMENT
HISTORY
API
Contents
Introduction
........................................................................................................................................
3
Methods
.............................................................................................................................................
4
Retrieve
Engagement
List
by
Criteria
.............................................................................................
4
Request
.......................................................................................................................................
4
Response
....................................................................................................................................
9
Appendix
...........................................................................................................................................
18
Engagement
Attributes
................................................................................................................
18
CartStatus
.................................................................................................................................
18
customerInfo
............................................................................................................................
19
Lead
..........................................................................................................................................
20
marketingCampaignInfo
...........................................................................................................
21
personalInfo
.............................................................................................................................
22
Purchase
...................................................................................................................................
23
serviceActivity
...........................................................................................................................
24
VisitorError
...............................................................................................................................
25
viewedProduct
..........................................................................................................................
26
Sample
Code
....................................................................................................................................
27
2
LIVEENGAGE
ENGAGEMENT
HISTORY
API
Introduction
Brands can now search, filter and keep copies of chat transcripts and related data, for example
surveys, to later integrate and further analyze their data with third-party tools (DWH, CRM
systems, etc.). 99.5 % of chat transcript data is available within 5 minutes. All other chat transcript
data, including metadata, for example, Engagement Attributes, is available within 2 hours after a
chat has ended, and is stored for 13 months.
3
LIVEENGAGE
ENGAGEMENT
HISTORY
API
Methods
The LiveEngage Engagement History API includes 1 method:
Retrieve engagement list by criteria
Request
Method URL
POST https://<domain>/interaction_history/api/account/{accountID}/interactions/search
?<url_parameters>
URL Parameters
Optional:
4
LIVEENGAGE
ENGAGEMENT
HISTORY
API
BODY/POST Parameters
Filter is sent in the POST data with the following JSON structure.
Required:
Optional:
5
LIVEENGAGE
ENGAGEMENT
HISTORY
API
ive
Request example 1:
Simple Chat Search by time range
In the example below, we ask for chats that occurred between the 1st of June and the 30th of
June 2015.
{
"interactive":true,
"ended":true,
"start":{
"from":1433140200000,"to":1435645800000
}
}
Request example 2:
Keyword Search: Chat Search by time range and keyword
In the example below, we ask for chats that occurred between the 1st of June and the 30th of
June 2015, which contain the word iPad within the text available for lookup.
{
"interactive":true,
"ended":true,
"start":{
"from":1433140200000,"to":1435645800000
},
keyword: ipad,
"keyword_search_area": {
"types": [
"chatLine",
6
LIVEENGAGE
ENGAGEMENT
HISTORY
API
"surveyAnswer",
"surveyQuestion",
"ea.purchase",
"ea.viewedProduct",
"ea.cartStatus",
"ea.serviceActivity",
"ea.visitorError",
"ea.lead",
"ea.customerInfo",
"ea.marketingCampaignInfo",
"ea.personalInfo"
]
}
}
Request example 3:
In this example, we reduce the previous search, and require that the skill matches the skill IDs
{14, 17, 18} that were conducted by agentID 109 or 169, where the duration was between 0
and 180 seconds, and focus only on the transcript.
{
"interactive": true,
"ended": true,
"start": {
"from": 1437054059354,
"to": 1437661693023
},
"skillIds": [
"14",
"17",
"18"
],
"agentIds": [
"109",
"169"
],
"duration": {
"from": 0,
"to": 180
},
"keyword": "ipad",
"keyword_search_area": {"types": ["chatLine" ] }
}
Request example 4:
7
LIVEENGAGE
ENGAGEMENT
HISTORY
API
Chat Search by time range and mcs
In this example, we are searching for chats that have a positive mcs.
{
"interactive": true,
"ended": true,
"start": {
"from": 1437054059354,
"to": 1437661693023
},
"keyword_search_area": {"types": ["mcs"]},"mcs": 1
}
8
LIVEENGAGE
ENGAGEMENT
HISTORY
API
Response
Example
{
"_metadata": {
"count": 9870,
"next": {
"rel": "next",
"href":
"http://localhost:8080/interaction_history/api/account/qa84481505/interactions/search?limit=50&offset=
50"
},
"last": {
"rel": "last",
"href":
"http://localhost:8080/interaction_history/api/account/qa84481505/interactions/search?limit=50&offset=
9850"
},
"self": {
"rel": "self",
"href":
"http://localhost:8080/interaction_history/api/account/qa84481505/interactions/search?limit=50&offset=
0"
},
"shardsStatusResult": {
"failureShards": 0,
"totalShards": 6,
"partialResult": false
}
},
"interactionHistoryRecords": [
{
"info": {
"startTime": "2015-05-28 04:46:23.209+0000",
"startTimeL": 1432788383209,
"endTime": "2015-05-28 04:46:23.410+0000",
"endTimeL": 1432788383410,
"duration": 0,
"visitorId": "ozimnjlwddrzbhnfhjkdao",
"visitorName": "Joe",
"engagementId": "qa844815054294982965",
"isInteractive": true,
"accountId": "qa84481505",
"agentId": "3",
"agentName": "Greg",
"agentLoginName": "greg@liveperson.com",
"skillId": -1,
"skillName": "marketing",
"channel": 1,
9
LIVEENGAGE
ENGAGEMENT
HISTORY
API
"startReason": "0",
"startReasonDesc": "Visitor request",
"endReason": "210",
"endReasonDesc": "Visitor closed chat",
"engagementSet": 0,
"engagementSequence": 0,
"agentGroupId": -1,
"agentGroupName": "NA",
"mcs": null,
"ended": true,
"chatDataEnriched": false,
},
"transcript": {
"lines": [
{
"time": "2015-05-28 04:46:19.147+0000",
"timeL": 1432788379147,
"controlType": 4,
"text": "Thank you for choosing to chat with us. An agent will be with you shortly.",
"by": "info",
"source": "system",
"subType": "REGULAR",
"textType": "plain",
"cannedAnswerType": 0
},
{
"time": "2015-05-28 04:46:23.176+0000",
"timeL": 1432788383176,
"controlType": 3,
"text": "You are now chatting with hotopic@liveperson.com",
"by": "info",
"source": "system",
"subType": "REGULAR",
"textType": "plain",
"cannedAnswerType": 0
},
{
"time": "2015-05-28 04:46:23.411+0000",
"timeL": 1432788383411,
"controlType": 5,
"text": "Thank you for chatting with us.",
"by": "info",
"source": "system",
"subType": "REGULAR",
"textType": "plain",
"cannedAnswerType": 0
}
]
},
"campaign":{
"campaignEngagementId": "1759631410",
"campaignEngagementName": "Dummy1",
10
LIVEENGAGE
ENGAGEMENT
HISTORY
API
"campaignId": "1340122410",
"campaignName": "Live Chat on your site",
"goalId": "1340122310",
"goalName": "Interact with visitors",
"visitorBehaviorId": "1340122110",
"visitorBehaviorName": "Any behavior",
"visitorProfileId": "1340122010",
"visitorProfileName": "All visitors"
},
"visitorInfo": {
"country": "United States",
"state": "California",
"city": "San Jose",
"isp": "Comcast",
"org": "Amazon",
"device": "DESKTOP",
"ipAddress": "192.168.13.209",
"browser": "Chrome 47.0.2526.111",
"operatingSystem": "WINDOWS"
},
"sdes": {
"events": [
{
"cartStatus": {
"serverTimeStamp": "1435764972045",
"total": "11.7",
"numItems": "6",
"products": [
{
"quantity": "1",
"product": {
"name": "prod1",
"category": "category",
"sku": "sku",
"price": "7.8"
}
}
]
}
},
{
"customerInfo": {
"serverTimeStamp": "1436258709564",
"customerInfo": {
"customerStatus": "cancelled",
"customerType": "vip",
"balance": "-400.99",
"customerId": "138766AC",
"lastPaymentDate": {
"year": "2014",
"month": "10",
"day": "15"
11
LIVEENGAGE
ENGAGEMENT
HISTORY
API
},
"registrationDate": {
"year": "2013",
"month": "5",
"day": "23"
}
}
}
},
{
"lead": {
"lead": {
"topic": "luxury car test drive 2015",
"value": "22.22",
"leadId": "xyz123"
},
"serverTimeStamp": "1435780135906"
}
},
{
"marketingCampaignInfo": {
"serverTimeStamp": "1436703809351",
"marketingCampaignInfo": {
"originatingChannel": "1",
"affiliate": "Yahoo",
"campaignId": "US coupon campaign"
}
}
},
{
"personalInfo": {
"serverTimeStamp": "1436436923641",
"name": "ELI",
"surname": "leibovitz",
"gender": "MALE",
"company": "company",
"customerAge": {
"customerAgeInYears": "35.0",
"customerYearOfBirth": "1978",
"customerMonthOfBirth": "7",
"customerDateOfBirth": "25"
},
"contacts": [
{
"personalContact": {
"email": "myname@example.com",
"phone": "+1 212-788-8877"
}
}
]
}
},
12
LIVEENGAGE
ENGAGEMENT
HISTORY
API
{
"purchase": {
"total": "11.7",
"serverTimeStamp": "1434394476705",
"cart": {
"total": "17.8",
"serverTimeStamp": null,
"products": [
{
"quantity": "3",
"product": {
"name": "antivirus pro plan",
"category": "software",
"sku": "xyz001",
"price": "7.8"
}
}
],
"numItems": "13"
},
"orderId": "DRV1534XC"
}
},
{
"serviceActivity": {
"serverTimeStamp": "1435780135922",
"serviceActivity": {
"topic": "order checkbook",
"status": "0",
"category": "finance",
"serviceId": "service12"
}
}
},
{
"viewProduct": {
"serverTimeStamp": "1434394466093",
"products": [
{
"quantity": null,
"product": {
"name": "red high heel shoe",
"category": "women shoes",
"sku": "xyz567",
"price": "77.8"
}
}
]
}
},
{
"formFillingError": {
13
LIVEENGAGE
ENGAGEMENT
HISTORY
API
"serverTimeStamp": "1435764972047",
"visitorError": {
"contextId": "context.id",
"message": {
"string": "Expiration date missing"
},
"code": {
"string": "er100004"
},
"level": "2",
"resolved": "true"
}
}
}
]
}
}
]
}
14
LIVEENGAGE
ENGAGEMENT
HISTORY
API
duration Measurement of the duration of the engagement numeric
(in seconds). Amount of time the visitor is
connected to an agent until the Engagement
Window is closed.
visitorId visitor ID. alphanumeric (256)
visitorName The visitors name. alphanumeric
agentId agent ID. numeric
agentName The agents nickname. alphanumeric (256)
agentLoginName The agents login name. alphanumeric (256)
agentGroupId agent group ID. numeric
agentGroupName Name of the group the agent belongs to. alphanumeric (256)
skillId skill ID. numeric
skillName The skill name. alphanumeric (256)
isAgentSurvey Was there an agent survey in the engagement? boolean
isPostChatSurve Was there a post chat survey in the engagement? boolean
y
15
LIVEENGAGE
ENGAGEMENT
HISTORY
API
205 - Visitor disconnected
206 - Visitor started a new chat
207 - Visitor disconnected from other reasons
208 - Visitor was no longer in chat
209 - Visitor logged out
210 - Visitor closed chat
211 - Visitor logged out (SSO)
212 - Visitor abandoned request
213 - Reps unavailable
214 - Conversation is no longer valid
216 - Visitor is in chat
217 - Request timed out
218 - Server problem
219 - Rep logged out
220 - Visitor Session Limit Reached
222 - RSI Rep stopped chat
223 - RSI System stopped chat
224 - Inter-Account Transfer stopped chat
225 - Rep Refuse Chat
mcs Meaningful connection score of the chat (-1 - numeric
negative mcs, 0 neutral mcs, 1 positive mcs, null-
no mcs).
chatDataEnriche indication if the chat was enriched with final data. boolean
d If true, the enrichment process occurred.
chatStartUrl The pages url from which the chat started alphanumeric
chatStartPage The pages title from which the chat started alphanumeric
campaign campaign data of the chat container
campaignEngagem Id of the campaign's engagement. numeric
entId
16
LIVEENGAGE
ENGAGEMENT
HISTORY
API
textType Type of text. alphanumeric
[plain|html|url]
text The actual text in the chat line. alphanumeric
by Name of the visitor or the agent. alphanumeric
source Source of line. alphanumeric
[visitor|agent|system]
subType Visibility of line - to all or agent only alphanumeric
[REGULAR|
ONLY_TO_REP]
cannedAnswerTyp Type of canned answer (Predefined Content). numeric
e
17
LIVEENGAGE
ENGAGEMENT
HISTORY
API
value The visitors answer to the survey question. alphanumeric (1000)
name This surveys name. alphanumeric (256)
time This surveys submitted event time. alphanumeric (yyyy-
MM-
ddThh:mm:ss.SSS+tim
ezone)
timeL This surveys time in milliseconds. numeric
sdes List of Engagement Attributes. container (see
appendix).
Appendix
Engagement Attributes
Engagement Attributes allow a brand to communicate events, for example, purchases, visitor login,
shopping cart backout etc., from the webpage into LiveEngage. This section describes the data
retrieved in the response body. All engagement attribute values are of unlimited length (up to 50K
chars).
CartStatus
Example
{
"sdes": {
"events": [
{
"cartStatus": {
18
LIVEENGAGE
ENGAGEMENT
HISTORY
API
"serverTimeStamp": "1440412721832",
"total": "11.7",
"numItems": "6",
"products": [
{
"quantity": "1",
"product": {
"name": "prod1",
"category": "category",
"sku": "sku",
"price": "7.8"
}
}
]
}
}
]
}
}
customerInfo
19
LIVEENGAGE
ENGAGEMENT
HISTORY
API
"day": 21}
companySize The company size alphanumeric
Example:
{
"sdes": {
"events": [
{
"customerInfo": {
"serverTimeStamp": "1440412721833",
"customerInfo": {
"customerStatus": "cancelled",
"customerType": "vip",
"balance": "-400.99",
"customerId": "138766AC",
"socialId": 4444,
"imei": null,
"userName": null,
"accountName": null,
"role": null,
"lastPaymentDate": {
"year": "2014",
"month": "10",
"day": "15"
},
"registrationDate": {
"year": "2013",
"month": "5",
"day": "23"
},
"companySize": null
}
}
}
]
}
}
Lead
20
LIVEENGAGE
ENGAGEMENT
HISTORY
API
topic Topic lead. alphanumeric
value Value lead. alphanumeric
leadId Lead id. alphanumeric
Example:
{
"sdes": {
"events": [
{
"lead": {
"lead": {
"topic": "luxury car test drive 2015",
"value": "22.22",
"leadId": "xyz123"
},
"serverTimeStamp": "1440412721836"
}
}
]
}
}
marketingCampaignInfo
Example:
{
"sdes": {
"events": [
21
LIVEENGAGE
ENGAGEMENT
HISTORY
API
{
"marketingCampaignInfo": {
"serverTimeStamp": "1440412721833",
"marketingCampaignInfo": {
"originatingChannel": "1",
"affiliate": "Yahoo",
"campaignId": "US coupon campaign"
}
}
}
]
}
}
personalInfo
Example:
{
"sdes": {
"events": [
{
"personalInfo": {
22
LIVEENGAGE
ENGAGEMENT
HISTORY
API
"serverTimeStamp": "1440412721833",
"personalInfo": {
"name": "John",
"surname": "Doe",
"gender": "MALE",
"company": "company",
"customerAge": {
"customerAgeInYears": "34.0",
"customerYearOfBirth": "1980",
"customerMonthOfBirth": "4",
"customerDateOfBirth": "15"
},
"contacts": [
{
"personalContact": {
"email": "myname@example.com",
"phone": "+1 212-788-8877"
}
}
]
}
}
}
]
}
}
Purchase
23
LIVEENGAGE
ENGAGEMENT
HISTORY
API
numItems Number of items. alphanumeric
orderId Unique order Id. alphanumeric
Example:
{
"purchase": {
"total": "11.7",
"serverTimeStamp": "1434394476705",
"cart": {
"total": "17.8",
"products": [
{
"quantity": "3",
"product": {
"name": "antivirus pro plan",
"category": "software",
"sku": "xyz001",
"price": "7.8"
}
}
],
"numItems": "13"
},
"orderId": "DRV1534XC"
}
}
serviceActivity
24
LIVEENGAGE
ENGAGEMENT
HISTORY
API
category Category name. alphanumeric
serviceId Service Id. alphanumeric
Example:
{
"sdes": {
"events": [
{
"serviceActivity": {
"serverTimeStamp": "1440412721836",
"serviceActivity": {
"topic": "order checkbook",
"status": "0",
"category": "finance",
"serviceId": "service12"
}
}
}
]
}}
VisitorError
Example:
{
"sdes": {
"events": [
25
LIVEENGAGE
ENGAGEMENT
HISTORY
API
{
"visitorError": {
"serverTimeStamp": "1440412721834",
"visitorError": {
"contextId": null,
"message": "Expiration date missing",
"code": "er100004",
"level": null,
"resolved": null
}
}
}
]
}
}
viewedProduct
{
"sdes": {
"events": [
{
"viewedProduct": {
"serverTimeStamp": "1434394466093",
"products": [
{
"product": {
"name": "red high heel shoe",
"category": "women shoes",
"sku": "xyz567",
"price": "77.8"
}
}
]
26
LIVEENGAGE
ENGAGEMENT
HISTORY
API
}
}
]
}
}
Sample Code
Overview
This is a basic example of how to connect to the Engagement History API in Java by using Scribe.
In order to run the example, you will need to update the EngagementHistory.java file with your
Engagement History API credentials.
Sample 1:
https://github.com/scottwestover/LiveEngageExamples/blob/master/APIs/Java-
EngagementHistoryAPI/src/main/java/EngagementHistory.java#L8
Sample 2:
https://github.com/scottwestover/LiveEngageExamples/blob/master/APIs/Java-
EngagementHistoryAPI/src/main/java/EngagementHistory.java
-
L8
https://github.com/scottwestover/LiveEngageExamples/blob/master/APIs/Java-
EngagementHistoryAPI/src/main/java/EHAPI.java
This document, materials or presentation, whether offered online or presented in hard copy ("LivePerson Informational Tools") is for informational purposes only.
LIVEPERSON, INC. PROVIDES THESE LIVEPERSON INFORMATIONAL TOOLS "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT
NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
The LivePerson Informational Tools contain LivePerson proprietary and confidential materials. No part of the LivePerson Informational Tools may be modified,
altered, reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), without the prior written permission of LivePerson, Inc., except as otherwise permitted by law. Prior to publication, reasonable effort was made to validate
this information. The LivePerson Information Tools may include technical inaccuracies or typographical errors. Actual savings or results achieved may be different
from those outlined in the LivePerson Informational Tools. The recipient shall not alter or remove any part of this statement.
Trademarks or service marks of LivePerson may not be used in any manner without LivePerson's express written consent. All other company and product names
mentioned are used only for identification purposes and may be trademarks or registered trademarks of their respective companies.
LivePerson shall not be liable for any direct, indirect, incidental, special, consequential or exemplary damages, including but not limited to, damages for loss of profits,
goodwill, use, data or other intangible losses resulting from the use or the inability to use the LivePerson Information Tools, including any information contained
herein.
27
LIVEENGAGE
ENGAGEMENT
HISTORY
API
2016 LivePerson, Inc. All rights reserved.
28