|
|
(3 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| = API Commands = | | = API Commands = |
| | | |
− | Once you've registered your own plugin on the bus, you can call commands on other registered plugins. Below we'll quickly register a new plugin on the bus using the global bus object.
| + | {{Template:PEC_Migrated}} |
| | | |
− | {{NoteFormat|The global bus object is a debug tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see [[GWCBusExtensions|Widgets Extensions]] for more information about extending Genesys Widgets.|1}}
| |
| | | |
| | | |
− | <source lang='javascript'>var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
| + | {{NoteFormat|Documentation for this software has moved to a new home. Please update links and bookmarks to content hosted at https://all.docs.genesys.com/WID/Current/SDK/StatsService-combined#API_Commands.}} |
− | | |
− | oMyPlugin.command('StatsService.getUserAgent');</source>
| |
− | | |
− | == configure ==
| |
− | Internal use only. The main App plugin shares configuration settings to widgets using each widget’s configure command. The configure command can only be called once at startup. Calling configure again after startup may result in unpredictable behavior.
| |
− | <br /><br />
| |
− | === Example ===
| |
− | <source lang='javascript'>
| |
− | oMyPlugin.command('StatsService.configure', {
| |
− | | |
− | ewt:{
| |
− | | |
− | apikey: '12345',
| |
− | dataURL: 'http://localhost:8080/foo/bar'
| |
− | },
| |
− | ajaxTimeout: 10000
| |
− | | |
− | }).done(function(e){
| |
− | | |
− | // StatsService configured successfully
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // StatsService failed to configure
| |
− | });
| |
− | </source>
| |
− | | |
− | <br />
| |
− | === Options ===
| |
− | {|
| |
− | |-
| |
− | ! Option
| |
− | ! Type
| |
− | ! Description
| |
− | |-
| |
− | | ewt.apikey
| |
− | | string
| |
− | | API access token. Please contact your Genesys representative to obtain your API access token.
| |
− | |-
| |
− | | ewt.dataURL
| |
− | | URL String
| |
− | | URL of GMS server
| |
− | |-
| |
− | | ajaxTimeout
| |
− | | number
| |
− | | Number of milliseconds to wait before AJAX timeout.
| |
− | |-
| |
− | |}
| |
− | <br />
| |
− | | |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | When configuration options are provided and set
| |
− | | n/a
| |
− | |-
| |
− | | rejected
| |
− | | When no configuration options are provided
| |
− | | 'Invalid configuration'
| |
− | |-
| |
− | |}
| |
− | == getStats ==
| |
− | Make a request to Genesys Stats server to fetch EWT details.
| |
− | <br /><br />
| |
− | === Example ===
| |
− | <source lang='javascript'>
| |
− | oMyPlugin.command('StatsService.getStats', {
| |
− | | |
− | group: 'EWT',
| |
− | vqname: 'chat_ewt_test_eservices'
| |
− | | |
− | }).done(function(e){
| |
− | | |
− | // StatsService got stats successfully
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // StatsService failed to get stats
| |
− | });
| |
− | </source>
| |
− | | |
− | <br />
| |
− | === Options ===
| |
− | {|
| |
− | |-
| |
− | ! Option
| |
− | ! Type
| |
− | ! Description
| |
− | |-
| |
− | | group
| |
− | | string
| |
− | | Mention specific group name you would like to request like EWT, etc.
| |
− | |-
| |
− | | vqname
| |
− | | string
| |
− | | Mention virtual queue name for EWT.
| |
− | |-
| |
− | |}
| |
− | <br />
| |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | When server returns EWT data
| |
− | | (AJAX Response Object)
| |
− | |-
| |
− | | rejected
| |
− | | When server fail request fails
| |
− | | 'EWT request failed due to unknown reason'
| |
− | |-
| |
− | | rejected
| |
− | | When no EWT dataURL provided
| |
− | | 'Invalid EWT configuration'
| |
− | |-
| |
− | |}
| |
− | == getUserAgent ==
| |
− | Receive User Agent data from the browser
| |
− | <br /><br />
| |
− | === Example ===
| |
− | <source lang='javascript'>
| |
− | oMyPlugin.command('StatsService.getUserAgent').done(function(e){
| |
− | | |
− | // StatsService got user agent data successfully
| |
− | // e == Object of User agent data
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // StatsService failed to get user agent data
| |
− | }); | |
− | </source>
| |
− | | |
− | <br />
| |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | Always
| |
− | | UAParser object with functions to find browser ( .getBrowser() ), OS ( .getOS() ), mobile/web detection ( .mobileCheck() )
| |
− | |-
| |
− | |}
| |
| | | |
| [[Category:V:PSAAS:Public]] | | [[Category:V:PSAAS:Public]] |