ServiceNow OpenFrame Integration

Hi i've integrated the Embeddeble Framework on ServiceNow, i've also referenced the Openframe API library, but i have an issue because when i try to access to window.PureCloud i receive an error that PureCloud is undefined:

my iframe inside the openframe is:

< id="genesysFrame" allow="camera *; microphone *" style="border:0px;margin:0px;" width="100%" height="100%" src="Genesys Cloud Embeddable Framework">

i'm trying to retrieve it using:
var genesysFrame = document.getElementById('genesysFrame');
var frameWindow = genesysFrame.contentWindow;
frameWindow.postMessage(JSON.stringify({
type: 'addCustomAttributes',
data: {
interactionId: interactionId,
attributes: { record_url: recordUrl }
}
}), 'https://apps.mypurecloud.ie');
interaction.record_url = recordUrl;

but doesn't work, any ideas?
Thanks

Is this literally what you have in the HTML:

< id="genesysFrame" allow="camera *; microphone *" style="border:0px;margin:0px;" width="100%" height="100%" src="Genesys Cloud Embeddable Framework">

If so, "Genesys Cloud Embeddable Framework" is not a valid URL.

Assuming you are using a Private Deployment then you'll need to use one of the URLs in the examples in this article: https://developer.genesys.cloud/platform/embeddable-framework/deployments/private-deployment. Note, the article assumes a US East region, so you'll need to change the host to apps.mypurecloud.ie for your region.

Hi Jim,
thanks for answering me, i solved, i just replicated what i found on the GitHub's example. Being on the Openframe frame i just call the function:

function addAttribute(interactionId, recordUrl) {
console.log('Adding attribute to interaction:', interactionId);
document.getElementById("genesysFrame").contentWindow.postMessage(JSON.stringify({
type: 'addAttribute',
data: {
interactionId: interactionId,
attributes: { record_url: recordUrl }
}
}), "*");

using document.getElementById("genesysFrame").contentWindow.postMessage(JSON.stringify the framework.js receiveis the request and triggers the action.
Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.