Send survey results to LivePerson

After receiving and processing a survey for a LivePerson interaction, Medallia Experience Cloud can send key survey results to LivePerson using the OmniExporter as a webhook. OmniExporter is a service that uses HTTP to pass survey record data to external systems.

To setup the webhook to send data to LivePerson, create an OmniExporter in Medallia Experience Cloud setup. You will need

  • LivePerson account ID

  • LivePerson login OAuth URL and credentials

  • Names of the survey fields to send to LivePerson, and the matching names of the LivePerson fields to receive the data

Trigger

Trigger propertyValue
Trigger byField value changes
Data objectSurvey
Trigger an event on record UPDATEOn
Triggering fieldse_bp_cc_liveperson_enrichment_completed_yn
Matching condition
e_bp_cc_record_type_liveperson_yn = 1 and e_status = 1 and e_bp_cc_liveperson_metrics_sync_completed_yn != 1 and e_bp_cc_liveperson_enrichment_completed_yn = 1

Login settings

Login propertyValue
Login MethodOAuth
Login URL TypeStatic
Login URL
https://va-a.sentinel.liveperson.net/sentinel/api/account/{lp-account-id}/app/token?v=1.0
Login Headers TypeStatic
Login Headers
grant_type : client_credentials,
client_id : {lp-account-client-id}
client_secret : {lp-account-client-secret}

HTTP Request Assembly

HTTP Request Assembly propertyValue
HTTP MethodPOST
URL TypeStatic
URL
{LP-host-instance}/api​/v1​/account​/{LP-accountId}​/medallia​/metric
Headers TypeStatic
Headers
'Authorization: Bearer $TOKEN$'
Fields used in the actionSelect the survey fields to send to LivePerson. Minimally include:
  • e_bp_customer_id_txt

  • e_bp_cc_liveperson_conversation_id_txt

  • a_surveyid

Body TypeJavaScript
BodyJavaScript code to build a JSON payload to send to LivePerson.

The JavaScript in the request body needs to return a JSON payload that maps the survey field values to their corresponding LivePerson fields, similar to this:

// Get fields for the record to be sent
var entities=data.changedEntities;
// Set entity for readability
var entity = entities[0]; 
var consumerId = entity.e_bp_customer_id_txt;
var conversationId = entity.e_bp_cc_liveperson_conversation_id_txt;
// Add your survey program's CSAT Field below (If it is not 5 scale then convert it to 5 scale in a k-field and use that instead)
var csat = entity["ADD_CSAT_FIELD"] + "";

var request = 
{
  "lpConversationId": conversationId,
  "lpConsumerId": consumerId,
  "csat": csat
}
write (JSON.stringify(request));

HTTP Response

After sending the survey response, LivePerson returns a JSON payload that contains the LivePerson field values for the chat record. By setting up a response processor, the LivePerson values can be inserted into the Medallia Experience Cloud record.

The JavaScript in the response processor returns a JSON payload result that maps the LivePerson field values to their corresponding Medallia Experience Cloud fields, similar to this:

var responseStatusCode = JSON.parse(http.getResponseStatusCode());
var job={};

var record=data.changedEntities[0];

// Successful call
if(responseStatusCode == '200'||responseStatusCode == '201'||responseStatusCode == '204'){
	job={
		"medalliaId" : record.a_surveyid,
	};
}
write(JSON.stringify([job]));