On Answer Screenpop
Creating the On Answer Screenpop Script
Screenpops in Genesys PureCloud are performed by scripts created in the Admin console and invoked by the call flows managed in Architect. In this section we will be creating a script capable of triggering an OpenMethods Popflow screenpop from scratch. You may also import the following example script and modify it for your environment.
Log in to Genesys PureCloud and select Collaborate / Communicate
Navigate to the Admin screen by clicking Admin in the top bar (highlighted in red)
Find the Contact Center section of the Admin screen and click Scripts (highlighted in red) to list current scripts
Click the Create button to create a new script. This will start script creation process
Give this script a name to indicate it’s purpose, such as OpenMethods ScreenPop. Make sure the Blank Script template is selected and click the Create button to open the script editor
Open the Actions tab of the tool box panel on the right side of the screen
Click the “+” button to the right of Actions to add a new custom action to the script and bring up the Action editor screen
Provide the action with a name, for example “Call Connect API” and click the Add Step button to add a step to the custom action
Click the downward pointed arrow next to Scripter to expand the section
Scroll down in the popup panel and click Open URL from the list to add the step to the action editor screen
In the Open URL step section of the action editor screen, enable Open in New Window and change the default width and height of the window to something small. In the example we use 50x50. This window will automatically close as part of the screen pop process
Add the base Connect API url into the URL text area (including the '?' at the end)
North America: https://connect.openmethodscloud.com/api/sendmessage/bc/CTI?
Europe/GDPR: https://connect.gdpr.openmethodscloud.com/api/sendmessage/bc/CTI?
Add the jwt parameter to the url with the API Key obtained during the first step as the value. Keep in mind your API Key will be very long
Add the event parameter to the url with “On+Answer” as the value (Don’t forget to put the ‘&' in front of 'event’
Add the agentId parameter to the url. The value will be added in the next steps
Click on the Insert Variable button above the text area to bring up the variable selection popup panel. Make sure the text cursor is located after the '=' for the agentId parameter or the value will be put in the wrong place
Scroll down to and select Scripter.Agent Email from the list to automatically add the value to the url field
Add the ANI parameter to the url. The value will be added in the next steps
Click on the Insert Variable button above the text area to bring up the variable selection popup panel. Make sure the text cursor is located after the '=' for the ANI parameter or the value will be put in the wrong place
Scroll down to and select Scripter.Agent Email from the list to automatically add the value to the url field
Click the Save button to save the custom action
Click the Script menu button at the top of the script editor page to bring up the Script menu
Select the Script Properties menu item to bring up the Script Properties panel on the right side of the script editor
Click on Inbound to expand the options for Inbound calls
Click the Disabled slider to enable this script for inbound calls
Click the Page icon at the bottom of the script editor to open the main script properties panel on the right side of the editor
Click the Page Load Action button to bring up the action selection panel
Click the Custom category to expand it
Click the custom action created earlier
Click the Select button to select the action
Click the Script menu button again to bring up the script menu
Click the Save menu option to save the script
A notification will display in the upper right corner of the script editor to indicate the script was saved
Click the Script menu button again to open the script menu and click Publish to publish the script to make it available for use in call flows
As with Save, a notification will be displayed when the script has finished being published
Log out of the PureCloud application
Add Set Screenpop to Inbound Call Flow
Log in to PureCloud as an administrator and click Architect to open the PureCloud Architect application
Click on the inbound call flow that will trigger the OpenMethods screenpop to open the call flow editor
There are two likely scenarios you’ll face adding the OpenMethods screenpop logic to an existing call flow: Top Level Transfer to ACD and Add to Existing Task. If the transfer action is already contained in a task, skip down to Add to Existing Task.
Top Level Transfer to ACD
You may find that the Transfer to ACD action is located directly under a menu option. In order to add the OpenMethods screenpop, we’ll first need to move this action into a new Task. When finished, we can continue with Add to Existing Task.
Locate the Task category in the Toolbox panel and click it to expand the category
Click on Task and drag it into the menu that contains the transfer action
Click on the vertical ellipse button to the right of the action to bring up the action menu
Click Copy button to copy the existing transfer action to the clipboard
Click on the newly add Task under the menu to show the task editor panel
Click the Add action here button in the task editor to bring up the menu
Click the Transfer to ACD menu option to add the action to the task. If the menu option isn’t available, perform steps 3 & 4 and try again
Click on the Disconnect category in the toolbox panel to expand the category
Click and drag the Disconnect action to the Add action here block below the Failure result for the Transfer to ACD action. You may want to add different behavior for failures but that is outside the scope of this document
Click the vertical ellipse button to the right of the transfer action to bring up the menu
Click the delete menu option to remove the original transfer action from the menu
Click the new task to bring up the task editor
Click the DTMF button to bring up the dtmf menu
Click the number button corresponding to the original transfer action
Click the task name at the top of the task editor to edit the task name
Provide a name for the task and click the done button to save the name
Add to Existing Task
If the transfer action is already contained within a task action, we can simply add our screenpop behavior to the task.
Click on the task action that contains the transfer action to open the task editor
Locate the Flow category in the toolbox panel and click it to expand the category
Click and drag the Set Screen Pop action onto the Start block of the task action. You can also drag the action onto other blocks to insert it there as long as the Set Screen Pop is before the transfer action
In the Set Screen Pop action details panel on the right side of the task editor, click the Screen Pop Script dropdown, locate the screen pop script you created earlier, and select it
Click the Save button to save your changes
Click the Publish button to publish your changes to the live environment
Create On End Trigger
Add WebApp Integration
Log in to Genesys PureCloud and select Collaborate / Communicate
Navigate to the Admin screen by clicking Admin in the top bar (highlighted in red)
Click “Integrations” in the Integrations section
Click “+ Integrations” to add a new integration
Scroll down and find “Web Services Data Actions” and click install
Enable the integration by clicking the “Inactive” slider
Confirm the activation by clicking “Yes”
Save the changes to the integration by clicking “Save”
Creating the On End Action
Log in to Genesys PureCloud and select Collaborate / Communicate
Navigate to the Admin screen by clicking Admin in the top bar (highlighted in red)
Click “Actions” under the Integrations section
Click “Add Action”
Select the integration created in the previous section
Provide a name for the new action and click “Add”
Click “Setup” to configure the action
Switch to the JSON view for both Input Contract and Output Contract
Copy and paste the text below into the Input Contract text area
{
"type": "object",
"properties": {
"jwt": {
"type": "string"
},
"ANI": {
"type": "string"
},
"agentId": {
"type": "string"
},
"event": {
"type": "string"
}
},
"required": ["jwt", "ANI", "agentId", "event"]
}Copy and paste the text below into the Output Contract text area
{
"type": "object",
"properties": {
"result": {
"type": "string"
},
"message": {
"type": "string"
}
}
}Click “Configuration”
Click “GET” to open the context menu and select “POST”
Fill out the request url depending on your location
North America: https://connect.openmethodscloud.com/api/sendmessage/CTI
Europe/GDPR: https://connect.gdpr.openmethodscloud.com/api/sendmessage/CTI
Copy and paste the text below into the Request Body Template text area
{
"jwt": "${input.jwt}",
"agentId": "${input.agentId}",
"event": "${input.event}",
"ANI": "${input.ANI}"
}Click “Save & Publish”
Confirm the publish request by clicking “Yes”
Create On End Workflow
Log in to PureCloud as an administrator and click Architect to open the PureCloud Architect application
Change the flow type by clicking Flows: Inbound Call and selecting Workflow
Click “Add” to create a new workflow
Provide a name for the new workflow and click “Create Flow”
Click the Data item of the Resources section in the left-hand navigation panel
Enter “userId” into the variable name field and click “Create”
Click “Flow.userId” to open the edit dialog box
Enable the “Input to flow” checkbox and click “Save”
Enter “ani” into the variable name field and click “Create”
Click “Flow.ani” to open the edit dialog box
Enable the “Input to flow” checkbox and click “Save”
Click “Initial State” item of the Starting State section in the left-hand navigation panel
Click the Binoculars icon to open the sub menu. Click and drag the Find User by ID action onto the start block in the workflow canvas
Enter Flow.userId into the User ID field
Enter Flow.user into the User Result field
Click the Database icon to open the sub menu. Click and drag the Call Data Action onto the Found path below the Find User by ID block in the workflow canvas
Give the action a name
Select “Web Services Data Action” from the Category drop-down
Select “OpenMethods OpenConnect” (or the name you chose) from the Data Action drop-down
Provide your company’s JWT (this was obtained at the top of this guide
Click the page icon next to the ANI field and select “Expression” from the context menu
Enter “Flow.ani” into the ANI field
Click the page icon next to the agentId field and select “Expression” from the context menu
Enter “Flow.user.username” into the agentId field
Enter “On End” into the event field
Any additional steps for error handling is an exercise for the reader.
Click “Save” to save the workflow
Click “Publish” to publish the workflow
Create On End Trigger
Log in to Genesys PureCloud and select Collaborate / Communicate
Navigate to the Admin screen by clicking Admin in the top bar (highlighted in red)
Click the Triggers link under Architect
Click the “+ Add Trigger” button
Provide a name and description for the new trigger and click “Add”
Select “v2.detail.events.conversation.{id}.user.end” from the Topic Name drop-down
Select the workflow you created in the previous section from the Workflow Target drop-down
Click “Create” to create the trigger
Click the “Inactive” slider to activate the trigger
Click ‘Add Condition’ to add a filter to the trigger
Put ‘mediaType’ into the JSON Path field. Select ‘Equals (==)’ from the Operator drop-down. Put ‘'VOICE'’ into the Value field.
Click “Save” to save the changes