Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>PureCloud WebChat</title>
- </head>
- <script src="https://apps.mypurecloud.com/widgets/9.0/cxbus.min.js" onload="javascript:CXBus.configure({debug:false,pluginsPath:'https://apps.mypurecloud.com/widgets/9.0/plugins/'}); CXBus.loadPlugin('widgets-core');"></script>
- <body>
- <script>
- window._genesys = {
- "widgets": {
- "main": {
- "theme": "dark",
- "lang": "es",
- "customStylesheetID": "pata",
- "uploadsEnabled": "true"
- },
- "webchat": {
- "transport": {
- "type": "purecloud-v2-sockets",
- "dataURL": "https://api.mypurecloud.com",
- "deploymentKey": "8a2f84d5-b544-433a-8221-3adde69f6849",
- "orgGuid": "b6a2d4e3-6f08-4510-95c6-41c4ae858c76",
- "interactionData": {
- "routing": {
- "targetType": "QUEUE",
- "targetAddress": "Patagonia-Chat",
- "priority": 2
- }
- }
- },
- "userData": {
- "phoneNumber": "5411-4892-2045",
- "phoneType": "Cell"
- }
- }
- }
- };
- const customPlugin = CXBus.registerPlugin('Custom');
- customPlugin.subscribe('WebChatService.started', function (e) {
- console.log('Chat started', e);
- });
- customPlugin.subscribe('WebChatService.ended', function (e) {
- console.log('Chat ended', e);
- });
- </script>
- <script type="text/javascript">
- function getAdvancedConfig() {
- return {
- "form": {
- "autoSubmit": true,
- "firstname": "Juan",
- "subject": "E-Bank"
- },
- "formJSON": {
- "wrapper": "<table></table>",
- "inputs": [
- // Default fields
- {
- "id": "cx_webchat_form_firstname",
- "name": "firstname",
- "maxlength": "100",
- "placeholder": "Required",
- "label": "First Name"
- },
- {
- "id": "cx_webchat_form_subject",
- "name": "subject",
- "maxlength": "100",
- "placeholder": "Optional",
- "label": "Subject"
- }
- ]
- }
- };
- }
- </script>
- <button type="button" id="chat-button" onclick="customPlugin.command('WebChat.open', getAdvancedConfig());">Empezar chat</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement