requestPerformInteractionScreenPop
requestPerformInteractionScreenPop
Mandatory: no
Description: The requestPerformInteractionScreenPop feature is designed for Customer Relationship Management (CRM) systems. It triggers a screen pop within the CRM interface, displaying relevant customer information or interaction details based on the current context. This feature helps streamline workflows by providing immediate access to pertinent data without opening a separate pop-up window.
Implementation Example
// This is a part of the mandatory in-place event message handler
const processCRMConnectMessageData = async (event) => {
if (event.origin !== CRM_CONNECT_ORIGIN) {
return;
}
const { action, data } = event.data;
if (action === 'requestPerformInteractionScreenPop') {
processInteractionScreenPop(data);
}
};
// This is a dummy implementation for a basic ANI (originating address) screenpop
const processInteractionScreenPop = (data) => {
if (!data) {
return;
}
if (!data.aniValues) {
return;
}
const screenPopValue = data.aniValues[0] || data.aniValues[1];
screenPopUserByPhone(screenPopValue);
};
// This is a dummy screenPop use-case implementation using a generic CRM
// Data might differ based on the CRM you're using.
// This does not take into account priority order, multi-match and other corner cases
// Please adjust the methods accordingly!
const screenPopUserByPhone = async (phoneNumber) => {
const user = await findUserByPhoneNumber(phoneNumber);
await screenPopUser(user);
}
const findUserByPhoneNumber = async (phoneNumber) => {
const response = await <use_CRM_api_to_fetch_the_user_based_on_phoneNumber>;
const users = response.data.results;
if (response.status !== 200 || users.length === 0) {
// Error handling mechanism
return;
}
return users[0];
};
Message formats
CRM Connector
{ "type": "CRMConnectMessage", "action": "requestPerformInteractionScreenPop", "data": <crmConnectorDataObject> }
CRM Connector data object format
{
"aniValues": <array>, // A list of originating addresses
"dnisValues": <array>, // A list of destination addresses
"interactionData": <object>, // The interaction data object
"allowScreenPop": <boolean>
}
Updated 2 months ago