Genesys Guide
Genesys Settings
1. [Step 1]
Genesys License: Ensure the embedded feature is enabled in your Genesys portal settings.
2. [Step 2]
Enable embedded features seems to require uploading a .js file.
Sample Code of the .js file
window.Framework = {
config: {
name: "YourCRMName",//Name of your product
clientIds: {
"mypurecloud.com": "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",//OAuth Client ID for Genesys Cloud organization located in the AWS region
},
settings: {
embedWebRTCByDefault: true,
hideWebRTCPopUpOption: false,
enableCallLogs: true,
enableTransferContext: true,
dedicatedLoginWindow: true,
embeddedInteractionWindow: false,
enableConfigurableCallerId: false,
enableServerSideLogging: false,
enableCallHistory: true,
defaultOutboundSMSCountryCode: "+1", //The country code that the integration prefixes to numbers for outbound SMS interactions.
searchTargets: ["people", "queues", "frameworkContacts", "externalContacts"],
callControls: ["pickup", "hold", "mute", "transfer", "disconnect", "record", "securePause", "dtmf", "scheduleCallback", "flag", "requestAfterCallWork"],
theme: {
primary: "#d4cebd",
text: "#123",
},
}
},
initialSetup: function () {
window.PureCloud.subscribe([
{
type: 'Interaction',
callback: function (category, interaction) {
window.parent.postMessage(JSON.stringify({ type: "interactionSubscription", data: { category: category, interaction: interaction } }), "*");
}
},
{
type: 'UserAction',
callback: function (category, data) {
window.parent.postMessage(JSON.stringify({ type: "userActionSubscription", data: { category: category, data: data } }), "*");
}
},
{
type: 'Notification',
callback: function (category, data) {
window.parent.postMessage(JSON.stringify({ type: "notificationSubscription", data: { category: category, data: data } }), "*");
}
}
]);
window.addEventListener("message", function (event) {
try {
var message = JSON.parse(event.data);
if (message) {
if (message.type == "clickToDial") {
window.PureCloud.clickToDial(message.data);
} else if (message.type == "addAssociation") {
window.PureCloud.addAssociation(message.data);
} else if (message.type == "addAttribute") {
window.PureCloud.addCustomAttributes(message.data);
} else if (message.type == "addTransferContext") {
window.PureCloud.addTransferContext(message.data);
} else if (message.type == "sendContactSearch") {
if (contactSearchCallback) {
contactSearchCallback(message.data);
}
} else if (message.type == "updateUserStatus") {
window.PureCloud.User.updateStatus(message.data);
} else if (message.type == "updateInteractionState") {
window.PureCloud.Interaction.updateState(message.data);
} else if (message.type == "setView") {
window.PureCloud.User.setView(message.data);
} else if (message.type == "updateAudioConfiguration") {
window.PureCloud.User.Notification.setAudioConfiguration(message.data);
} else if (message.type == "sendCustomNotification") {
window.PureCloud.User.Notification.notifyUser(message.data);
}
}
} catch {
//ignore if you can not parse the payload into JSON
}
});
},
screenPop: function (searchString, interaction) {
window.parent.postMessage(JSON.stringify({ type: "screenPop", data: { searchString: searchString, interactionId: interaction } }), "*");
},
processCallLog: function (callLog, interaction, eventName, onSuccess, onFailure) {
window.parent.postMessage(JSON.stringify({ type: "processCallLog", data: { callLog: callLog, interactionId: interaction, eventName: eventName } }), "*");
var success = true;
if (success) {
onSuccess({
id: callLog.id || Date.now()
});
} else {
onFailure();
}
},
openCallLog: function (callLog, interaction) {
window.parent.postMessage(JSON.stringify({ type: "openCallLog", data: { callLog: callLog, interaction: interaction } }), "*");
},
contactSearch: function (searchString, onSuccess, onFailure) {
contactSearchCallback = onSuccess;
window.parent.postMessage(JSON.stringify({ type: "contactSearch", data: { searchString: searchString } }), "*");
}
};
3. [Step 3]
Update these three variables and then upload the .js file.
For reference, you can review the documentation below:
[https://help.mypurecloud.com/articles/add-a-private-genesys-cloud-embeddable-framework-integration/]
[https://developer.genesys.cloud/platform/embeddable-framework/configMethods/clientIds] (OAuth Client IDs)
[https://developer.genesys.cloud/platform/embeddable-framework/configMethods] (Configuration and methods)
Saving Comment...