Jump to: navigation, search
(Update with the copy of version: 8.5.0)
(Automated save: adding PEC_Migrated template.)
 
(One intermediate revision by one other user 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/Toaster-combined#API_Commands.}}
 
 
oMyPlugin.command('Toaster.close');</source>
 
 
 
== open ==
 
Opens the Toaster UI.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('Toaster.open', {
 
 
 
type: 'generic',
 
title: 'Toaster Title',
 
body: 'Toaster Body',
 
icon: 'chat',
 
controls: 'close',
 
immutable: false,
 
buttons:{
 
 
 
type: 'binary',
 
primary: 'Accept',
 
secondary: 'Decline'
 
}
 
 
 
}).done(function(e){
 
 
 
// Toaster opened successfully
 
 
 
}).fail(function(e){
 
 
 
// Toaster failed to open properly
 
});
 
</source>
 
 
 
<br />
 
 
 
[[Category:V:GWC:Draft]]
 
 
 
=== Options ===
 
{|
 
|-
 
! Option
 
! Type
 
! Description
 
|-
 
| type
 
| string
 
| Specifies the type of body content that can be provided to toaster window. Generic type shows the default body content and custom type overrides the default html body content.
 
|-
 
| title
 
| string
 
| Heading title to display on the toaster window.
 
|-
 
| body
 
| string
 
| Holds text value for Generic toaster type and html string template for Custom toaster type.
 
|-
 
| icon
 
| string
 
| The CSS class name for an icon.
 
|-
 
| controls
 
| string
 
| Show close and minimize controls on toaster window.
 
|-
 
| buttons
 
| object
 
| Define the type of buttons.
 
|-
 
| buttons.type
 
| string
 
| Shows two buttons on the toaster.
 
|-
 
| buttons.primary
 
| string
 
| Text to be shown on primary button.
 
|-
 
| buttons.secondary
 
| string
 
| Text to be shown on secondary button.
 
|-
 
| immutable
 
| boolean
 
| When set to true, toaster cannot be closed by other plugins.
 
|-
 
|}
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When Toaster is successfully opened
 
| n/a
 
|-
 
| rejected
 
| When no toaster type is specified
 
| 'No content was provided. Toaster has ignored your command'
 
|-
 
| rejected
 
| When toaster is already opened
 
| 'Toaster view is currently reserved'
 
|-
 
|}
 
== close ==
 
Closes the Toaster UI.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('Toaster.close').done(function(e){
 
 
 
// Toaster closed successfully
 
 
 
}).fail(function(e){
 
 
 
// Toaster failed to close
 
});
 
</source>
 
 
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When toaster is successfully closed.
 
| n/a
 
|-
 
| rejected
 
| When Toaster is already closed.
 
| 'Toaster view is already closed'
 
|-
 
| rejected
 
| When Toaster view is immutable.
 
| 'Toaster view is currently reserved'
 
|-
 
|}
 
 
 
 
[[Category:V:PSAAS:Public]]
 
[[Category:V:PSAAS:Public]]

Latest revision as of 23:22, June 21, 2020

API Commands

Important
This content may not be the latest Genesys Engage cloud content. To find the latest content, go to Genesys Engage cloud for Administrators.



Important
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/Toaster-combined#API_Commands.
This page was last edited on June 21, 2020, at 23:22.
Comments or questions about this documentation? Contact us for support!