requestSaveInteractionLog

requestSaveInteractionLog

Mandatory: No

Description: At the end of an interaction, whether Voice or Digital, the CRM Connector application sends a message containing all the data from that interaction. This message can be saved as an Interaction Log record in the CRM.

It is important that the client application composes its own body and new record structure based on the restrictions and recommendations of the CRM it uses. The CRM Connector application does not impose any restrictions, so it sends the entire interaction body, allowing each customer to create the Interaction Log according to their business needs.

The data options that can be saved are listed in the table below, but keep in mind that these data vary depending on the environment. The AXP and Elite Voice columns indicate whether the data is present in the respective environment.

Additionally, the client application developer must examine the object to understand how to access each field.

This feature uses one-way messages, so the client application does not need to send a confirmation back to the CRM Connector after saving the log.

Implementation Example

// This is a part of the mandatory in-place event message handler
export const processCRMConnectMessageData = async (event) => {
  if (event.origin !== CRM_CONNECT_ORIGIN) { 
      return; 
  }

  const { action, data } = event.data;
  clientIframe = document.getElementById('crmConnectIframeId');

  if (action === 'requestSaveInteractionLog') {
    processSaveInteractionLog(data)
  }
};

const processSaveInteractionLog = (data) => {
  const composedInteractionData = composeInteractionLog(data.message.body);
  saveInteractionLog(composedInteractionData);
}

const composeInteractionLog = (data) => {
  /* 
  Please note that this is a dummy implementation and the objects 
  you see might not reflect the format your CRM needs.

  In order to save the interaction log on your CRM you must consult
  its documentation and build a log object following it.
  */
  if (!data || !data.interactionId || !data.interactionData) {
    return;
  }

  const externalInteractionId = data.interactionId;
  const interactionDetails = data.interactionData;
  const durationInSeconds = retrieveDurationInSeconds(interactionDetails.interaction.intrinsics?.START_TIME);

  const interactionDataPackage = {
    custom_object_record: {
      name: externalInteractionId,
      external_id: externalInteractionId,
      custom_object_fields: {
        caller: interactionDetails.updatedOriginatingAddress,
        called: interactionDetails.updatedDestinationAddress,
        duration: durationInSeconds + '',
        // Add how many fields are necessary
      }
    }
  }
}

const saveInteractionLog = async (interactionData) => {
    /* 
    Implement the mechanism in order to save the interaction log, 
    with the data you need from the table below.
    */
}

Table with the data that can be saved in an interaction log record

NameDescriptionAXPElite Voice
ACW DurationThe duration in seconds for the After Contact Work timeYesYes
AttributesThe attributes of an AXP interaction. E.g language, departmentYesNo
ChannelThe channel for the interaction. E.g Email, Chat, Messaging, VoiceYesYes
Destination AddressThe destination address of the interactionYesYes
DirectionThe direction of the interaction. The possible values are: Inbound, Outbound or InternalYesYes
Established TimeThe established time of the interaction in UTC.YesYes
Interaction TypeThe type of the interaction. Possible values are: Called, Transferred, ConferencedYesYes
Interaction IDA unique identifier for the interactionYesYes
PriorityThe priority of the interactionYesNo
Resource AddressThe station id of the agent.YesYes
Updated Originating AddressThe Originating Address after the Call Center dialing rules are appliedYesYes
Updated Destination AddressThe Destination Address after the Call Center dialing rules are appliedYesYes
Work CodesList of the work codes selected by the agent during active or while in ACW states.NoYes
Interaction OriginThe origin of the interaction. This has 3 possible values: AXP, Elite or [AXP,Elite]YesYes
Caller NameThe name of the originating party who initiated the interaction.YesYes
Caller NumberThe number of the originating party who initiated the interaction.YesYes
DNISThe number of the destination party who received the interaction.YesYes
Start DateThe standard date format when interaction startsYesYes
Start TimeThe standard time format when interaction startsYesYes
Topic IDThe Topic ID used to route the interaction. It is also known as Queue NumberYesNo
Topic NameThe Topic Name used to route the interaction. It is also known as Queue NameYesNo
UUIUUI values are defined in Call Center EliteNoYes
ASAI UUIASAI UUI contains the caller information, such as a destination number.NoYes
UCIDThe Universal Call ID. The UCID is a unique call ID that distinguishes a call from all other calls that the contact center processes simultaneouslyYesYes
End TimeThe standard date format when interaction endsYesYes
Skill IDThe ID of the skill used to route the Elite voice interaction.NoYes
Skill NameThe name of the skill used to route the Elite voice interaction.NoYes
Engagement ParametersThe engagement parameters passed from AXP flows. E.g availableBalanceYesNo
SubjectThe subject of the interaction logYesYes
Name IDThe name of the CRM object related to the interaction (in Salesforce Name and Related To point to different entities)YesYes
Related To IDThe name of the CRM object related to the interactionYesYes
CommentsThe comments added in the specific field when an interaction is in progress.YesYes
Name OptionsThe possible values from Name field. For example: multiple CRM Contacts and Cases associated with the interaction.YesYes
Related To OptionsThe possible values from Related To field. For example: multiple CRM Contacts and Cases associated with the interaction.YesYes
Disposition CodeThe disposition code used by the agent during active or while in ACW.YesNo
Custom FieldsThe list of customFields configured for the interaction.YesYes
SettingsThe list of options related to display name, relatedTo, comments. All of them booleans.YesYes
Is Transfer InteractionA boolean indicating whether the interaction is a transferYesYes
Is Conference InteractionA boolean indicating whether the interaction is a conferenceYesYes
Last Updated AtThe timestamp of when the draft was last updatedYesNo
Last Updated ByThe identifier of the user who last updated the draftYesNo
Draft IDA unique identifier for the draftYesNo
Draft Saved SuccessfullyA boolean indicating whether the draft was saved successfullyYesNo
Email Draft BodyThe body content of the email draftYesNo
Draft AttachmentsAn array of attachments included in the draftYesNo
Transferred ByThe identifier of the user who transferred the draftYesNo

Message formats

CRM Connector

{ "type": "CRMConnectMessage", "action": "requestSaveInteractionLog", "data": logDetails }