Legacy Dev Forum Posts

 View Only

Sign Up

ServiceNow OpenFrame Integration

  • 1.  ServiceNow OpenFrame Integration

    Posted 06-05-2025 19:04

    Alessandro_Iuliano | 2024-08-04 13:08:40 UTC | #1

    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="https://apps.mypurecloud.com/crm/embeddableFramework.html">

    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: { recordurl: recordUrl } } }), 'https://apps.mypurecloud.ie'); interaction.recordurl = recordUrl;

    but doesn't work, any ideas? Thanks


    crespino | 2024-08-05 16:09:12 UTC | #2

    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.


    Alessandro_Iuliano | 2024-08-06 07:20:11 UTC | #3

    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


    system | 2024-09-05 07:20:54 UTC | #4

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


    This post was migrated from the old Developer Forum.

    ref: 27601