|
|
(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/Callback-combined#API_Commands.}} |
− | | |
− | oMyPlugin.command('Callback.open');</source>
| |
− | | |
− | == open ==
| |
− | Opens the Callback UI.
| |
− | <br /><br />
| |
− | === Example ===
| |
− | <source lang='javascript'>
| |
− | oMyPlugin.command('Callback.open', {
| |
− | | |
− | form: {
| |
− | | |
− | autoSubmit: false,
| |
− | firstname: 'John',
| |
− | lastname: 'Smith',
| |
− | email: 'John@mail.com',
| |
− | subject: 'Customer Satisfaction',
| |
− | desiredTime: 'now',
| |
− | phonenumer: '8881110000'
| |
− | }
| |
− | | |
− | }).done(function(e){
| |
− | | |
− | // Callback opened successfully
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // Callback failed to open
| |
− | });
| |
− | </source>
| |
− | | |
− | <br />
| |
− | === Options ===
| |
− | {| | |
− | |-
| |
− | ! Option
| |
− | ! Type
| |
− | ! Description
| |
− | |-
| |
− | | form
| |
− | | object
| |
− | | Object containing form data to prefill in the callback form and optionally auto-submit the form.
| |
− | |-
| |
− | | form.autoSubmit
| |
− | | boolean
| |
− | | Automatically submit the callback form.
| |
− | |-
| |
− | | form.firstname
| |
− | | string
| |
− | | Value for the first name entry field.
| |
− | |-
| |
− | | form.lastname
| |
− | | string
| |
− | | Value for the last name entry field.
| |
− | |-
| |
− | | form.email
| |
− | | string
| |
− | | Value for the email entry field.
| |
− | |-
| |
− | | form.subject
| |
− | | string
| |
− | | Value for the notes entry field.
| |
− | |-
| |
− | | form.desiredTime
| |
− | | string
| |
− | | This Value is shared by the Date & Time section in the callback form. A string value 'now' pre-selects 'As soon As Possible' section and sets current local time as the desired time. When a string Date Time value/date object is passed, the desired time is set to this value in the Custom Date & Time input field. During form submission to the server desired time time is converted into UTC string format.
| |
− | |-
| |
− | | form.phonenumber
| |
− | | string
| |
− | | Value for the phone entry field. Should be a valid telephone number, when used with a prefix '+' auto selects the country flag near the phone input field.
| |
− | |-
| |
− | | form.userData
| |
− | | object
| |
− | | Arbitrary data that is to be attached with callback schedule. Properties defined here will be merged with default userData set in the configuration object.
| |
− | |-
| |
− | |}
| |
− | <br />
| |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | When callback form is successfully opened
| |
− | | n/a
| |
− | |-
| |
− | | rejected
| |
− | | When callback form is already open
| |
− | | 'already opened'
| |
− | |-
| |
− | |}
| |
− | == close ==
| |
− | Closes the Callback UI.
| |
− | <br /><br />
| |
− | === Example ===
| |
− | <source lang='javascript'>
| |
− | oMyPlugin.command('Callback.close').done(function(e){
| |
− | | |
− | // Callback closed successfully
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // Callback failed to close
| |
− | });
| |
− | </source>
| |
− | | |
− | <br />
| |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | When Callback form is successfully closed
| |
− | | n/a
| |
− | |-
| |
− | | rejected
| |
− | | When Callback form is already closed
| |
− | | 'already closed'
| |
− | |-
| |
− | |}
| |
− | == 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('Callback.configure', {
| |
− | | |
− | formValidation: true,
| |
− | countryCodes: true
| |
− | | |
− | }).done(function(e){
| |
− | | |
− | // Callback configured successfully
| |
− | | |
− | }).fail(function(e){
| |
− | | |
− | // Callback wasn't configured properly
| |
− | });
| |
− | </source>
| |
− | | |
− | <br />
| |
− | === Options ===
| |
− | {|
| |
− | |-
| |
− | ! Option
| |
− | ! Type
| |
− | ! Description
| |
− | |-
| |
− | | formValidation
| |
− | | boolean
| |
− | | Enable/disable browser form validations.
| |
− | |-
| |
− | | countryCodes
| |
− | | boolean
| |
− | | Enable/disable country flags display for phone numbers.
| |
− | |-
| |
− | |}
| |
− | <br />
| |
− | === Resolutions ===
| |
− | {|
| |
− | |-
| |
− | ! Status
| |
− | ! When
| |
− | ! Returns
| |
− | |-
| |
− | | resolved
| |
− | | When configuration options are provided and set
| |
− | | n/a
| |
− | |-
| |
− | | rejected
| |
− | | When no configuration options are provided
| |
− | | 'No configuration provided'
| |
− | |-
| |
− | |}
| |
| | | |
| [[Category:V:PSAAS:Public]] | | [[Category:V:PSAAS:Public]] |