Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PureCloud WebChat</title>
  6. </head>
  7. <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>
  8.  
  9. <body>
  10. <script>
  11. window._genesys = {
  12. "widgets": {
  13.  
  14. "main": {
  15. "theme": "dark",
  16. "lang": "es",
  17. "customStylesheetID": "pata",
  18. "uploadsEnabled": "true"
  19. },
  20. "webchat": {
  21. "transport": {
  22. "type": "purecloud-v2-sockets",
  23. "dataURL": "https://api.mypurecloud.com",
  24. "deploymentKey": "8a2f84d5-b544-433a-8221-3adde69f6849",
  25. "orgGuid": "b6a2d4e3-6f08-4510-95c6-41c4ae858c76",
  26. "interactionData": {
  27. "routing": {
  28. "targetType": "QUEUE",
  29. "targetAddress": "Patagonia-Chat",
  30. "priority": 2
  31. }
  32. }
  33. },
  34. "userData": {
  35. "phoneNumber": "5411-4892-2045",
  36. "phoneType": "Cell"
  37. }
  38. }
  39. }
  40. };
  41.  
  42. const customPlugin = CXBus.registerPlugin('Custom');
  43.  
  44. customPlugin.subscribe('WebChatService.started', function (e) {
  45. console.log('Chat started', e);
  46. });
  47.  
  48. customPlugin.subscribe('WebChatService.ended', function (e) {
  49. console.log('Chat ended', e);
  50. });
  51. </script>
  52. <script type="text/javascript">
  53. function getAdvancedConfig() {
  54. return {
  55. "form": {
  56. "autoSubmit": true,
  57. "firstname": "Juan",
  58. "subject": "E-Bank"
  59. },
  60.  
  61. "formJSON": {
  62. "wrapper": "<table></table>",
  63.  
  64. "inputs": [
  65. // Default fields
  66. {
  67. "id": "cx_webchat_form_firstname",
  68. "name": "firstname",
  69. "maxlength": "100",
  70. "placeholder": "Required",
  71. "label": "First Name"
  72. },
  73. {
  74. "id": "cx_webchat_form_subject",
  75. "name": "subject",
  76. "maxlength": "100",
  77. "placeholder": "Optional",
  78. "label": "Subject"
  79. }
  80. ]
  81. }
  82. };
  83. }
  84. </script>
  85. <button type="button" id="chat-button" onclick="customPlugin.command('WebChat.open', getAdvancedConfig());">Empezar chat</button>
  86. </body>
  87. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement