Difference between revisions of "PEC-Developer/Current/SCAPI/SystemNamespace"
From Genesys Documentation
(Published) |
(Published) |
||
Line 7: | Line 7: | ||
|Platform=GenesysEngage-cloud | |Platform=GenesysEngage-cloud | ||
|Section={{Section | |Section={{Section | ||
+ | |alignment=Vertical | ||
+ | |structuredtext={{NoteFormat|Depending on your environment, you might need to contact your Genesys representative to complete the configuration described on this page.|}} | ||
+ | |Status=No | ||
+ | }}{{Section | ||
|sectionHeading=Methods | |sectionHeading=Methods | ||
|anchor=Methods | |anchor=Methods | ||
Line 22: | Line 26: | ||
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isFrameLeadingOrNegotiating|display text=isFrameLeadingOrNegotiating}} | *{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isFrameLeadingOrNegotiating|display text=isFrameLeadingOrNegotiating}} | ||
*{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isLastActiveFrame|display text=isLastActiveFrame}} | *{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=isLastActiveFrame|display text=isLastActiveFrame}} | ||
+ | *{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=amIVisible|display text=amIVisible}} | ||
+ | *{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=openDialog|display text=openDialog}} | ||
+ | *{{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=closeDialog|display text=closeDialog}} | ||
===getAllowedServices=== | ===getAllowedServices=== | ||
Line 29: | Line 36: | ||
{{!}}- | {{!}}- | ||
!Description | !Description | ||
− | {{!}}Gets the list of allowed services, as determined by the | + | {{!}}Gets the list of allowed services, as determined by the {{Link-SomewhereInThisVersion|manual=SCAPI|topic=ServiceClientAPI|anchor=SecurityConfiguration|display text=Security configuration}}. If the domain of the web application that calls this method isn't listed in the [https://docs.genesys.com/Documentation/Options/Current/HTCC/GWS-interaction-workspace#service-client-api-accepted-web-content-origins service-client-api.accepted-web-content-origins] option, then this method fails. |
{{!}}- | {{!}}- | ||
!Returns | !Returns | ||
Line 41: | Line 48: | ||
{{!}}- | {{!}}- | ||
!Description | !Description | ||
− | {{!}}Triggers a fake activity to prevent the inactivity timer from closing the agent session. | + | {{!}}Triggers a fake activity to prevent the [https://docs.genesys.com/Documentation/Options/Current/HTCC/GWS-interaction-workspace#security-inactivity-timeout inactivity timer] from closing the agent session. |
{{!}}} | {{!}}} | ||
Line 48: | Line 55: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> popupToast(parameters) → {string} | + | {{!}}<static> popupToast(''parameters'') → {string} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 109: | Line 116: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> updateToast(id, parameters) → {boolean} | + | {{!}}<static> updateToast(''id'', ''parameters'') → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 172: | Line 179: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> closeToast(id) → {boolean} | + | {{!}}<static> closeToast(''id'') → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 197: | Line 204: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> isFrameLeading(succeeded, failed) → {boolean} | + | {{!}}<static> isFrameLeading(''succeeded'', ''failed'') → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 226: | Line 233: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> isFrameFollowing(succeeded, failed) → {boolean} | + | {{!}}<static> isFrameFollowing(''succeeded'', ''failed'') → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 255: | Line 262: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> isFrameNegotiating(succeeded, failed) → {boolean} | + | {{!}}<static> isFrameNegotiating(''succeeded'', ''failed'') → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 284: | Line 291: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> isFrameLeadingOrNegotiating(succeeded, failed) → {boolean} | + | {{!}}<static> isFrameLeadingOrNegotiating(''succeeded'', ''failed'') → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 313: | Line 320: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> isLastActiveFrame(succeeded, failed) → {boolean} | + | {{!}}<static> isLastActiveFrame(''succeeded'', ''failed'') → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 337: | Line 344: | ||
{{!}}<tt>true</tt> if this is the last active browser tab. | {{!}}<tt>true</tt> if this is the last active browser tab. | ||
{{!}}} | {{!}}} | ||
+ | ===amIVisible=== | ||
+ | |||
+ | {{{!}} | ||
+ | !Signature | ||
+ | {{!}}<static> amIVisible() → {boolean} | ||
+ | {{!}}- | ||
+ | !Description | ||
+ | {{!}}Get the current visibility state of the frame. | ||
+ | {{!}}- | ||
+ | !Returns | ||
+ | {{!}}<tt>true</tt> if the frame is visible. | ||
+ | {{!}}} | ||
+ | ====Sample request==== | ||
+ | <syntaxhighlight> | ||
+ | setTimeout(function() { | ||
+ | genesys.wwe.service.system.amIVisible(succeeded, failed); | ||
+ | }, 3000); // This gives 3 seconds to switch the panel to test. | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ====Sample response==== | ||
+ | The asynchronous answer is included in the <code>data</code> attribute:<syntaxhighlight> | ||
+ | { | ||
+ | "request": "system.amIVisible", | ||
+ | "data": true, | ||
+ | "userAgent": "WWE Server", | ||
+ | "protocolVersion": 2 | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===openDialog=== | ||
+ | {{{!}} | ||
+ | !Signature | ||
+ | {{!}}<static> openDialog(''url'', ''options'', ''succeeded'', ''failed'') → {string} | ||
+ | {{!}}- | ||
+ | !Description | ||
+ | {{!}}Open an iframe in a dialog, based on the configured parameters. | ||
+ | {{!}}- | ||
+ | !Parameters | ||
+ | {{!}} | ||
+ | {{{!}} | ||
+ | !Name | ||
+ | !Type | ||
+ | !Description | ||
+ | {{!}}- | ||
+ | {{!}}url | ||
+ | {{!}}string | ||
+ | {{!}}The URL of the iframe to load in the dialog. | ||
+ | {{!}}- | ||
+ | {{!}}options | ||
+ | {{!}}object | ||
+ | {{!}}Optional parameters to configure the dialog. This value can't be null, so you must pass <code>{}</code> if there are no specific options. You can include any of the following options: | ||
+ | |||
+ | *label - Set a custom value for the [https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute aria-label] attribute on the dialog. When the dialog pops up, this value identifies it to accessibility tools like screen readers. | ||
+ | *width - The initial width of the dialog. Valid formats are px or %. | ||
+ | *height - The initial height of the dialog. Valid formats are px or %. | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}string | ||
+ | {{!}}The callback function to use if the operation succeeded. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}string | ||
+ | {{!}}The callback function to use if the operation failed. | ||
+ | {{!}}} | ||
+ | {{!}}- | ||
+ | !Returns | ||
+ | {{!}}The dialog identifier or null if the <code>url</code> parameter is not defined. | ||
+ | {{!}}} | ||
+ | |||
+ | ====Sample request==== | ||
+ | <syntaxhighlight> | ||
+ | genesys.wwe.service.system.openDialog("<url>", { | ||
+ | label: "Dialog $Agent.FullName$", | ||
+ | width: "430px", | ||
+ | height: "325px" | ||
+ | }, succeeded, failed) | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ====Sample response==== | ||
+ | The asynchronous answer is included in the <code>data</code> attribute:<syntaxhighlight> | ||
+ | { | ||
+ | "request": "system.openDialog", | ||
+ | "data": "wweCustomDialog1", | ||
+ | "userAgent": "WWE Server", | ||
+ | "protocolVersion": 2 | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===closeDialog=== | ||
+ | {{{!}} | ||
+ | !Signature | ||
+ | {{!}}<static> closeDialog(''dialogId'', ''succeeded'', ''failed'') → {boolean} | ||
+ | {{!}}- | ||
+ | !Description | ||
+ | {{!}}Close a previously opened dialog. | ||
+ | {{!}}- | ||
+ | !Parameters | ||
+ | {{!}} | ||
+ | {{{!}} | ||
+ | !Name | ||
+ | !Type | ||
+ | !Description | ||
+ | {{!}}- | ||
+ | {{!}}dialogId | ||
+ | {{!}}string | ||
+ | {{!}}The dialog identifier (returned in the response of {{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=openDialog|display text=openDialog}}). | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}string | ||
+ | {{!}}The callback function to use if the operation succeeded. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}string | ||
+ | {{!}}The callback function to use if the operation failed. | ||
+ | {{!}}} | ||
+ | {{!}}- | ||
+ | !Returns | ||
+ | {{!}}<tt>true</tt> if the dialog is closed; <tt>false</tt> if the dialog is not found. | ||
+ | {{!}}} | ||
+ | |||
+ | ====Sample request==== | ||
+ | <syntaxhighlight> | ||
+ | genesys.wwe.service.system.closeDialog("wweCustomDialog1", succeeded, failed) | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ====Sample response==== | ||
+ | The asynchronous answer is included in the <code>data</code> attribute:<syntaxhighlight> | ||
+ | { | ||
+ | "request": "system.closeDialog", | ||
+ | "data": true, | ||
+ | "userAgent": "WWE Server", | ||
+ | "protocolVersion": 2 | ||
+ | } | ||
+ | </syntaxhighlight> | ||
|Status=No | |Status=No | ||
}} | }} | ||
}} | }} |
Revision as of 13:57, March 2, 2022
Contents
Learn about the System namespace methods in the Service Client API.
Important
Depending on your environment, you might need to contact your Genesys representative to complete the configuration described on this page.Methods
The System namespace includes the following methods:
- getAllowedServices
- triggerActivity
- popupToast
- updateToast
- closeToast
- isFrameLeading
- isFrameFollowing
- isFrameNegotiating
- isFrameLeadingOrNegotiating
- isLastActiveFrame
- amIVisible
- openDialog
- closeDialog
getAllowedServices
Signature | <static> getAllowedServices() → {Array.<string>} |
---|---|
Description | Gets the list of allowed services, as determined by the Security configuration. If the domain of the web application that calls this method isn't listed in the service-client-api.accepted-web-content-origins option, then this method fails. |
Returns | Array.<string> |
triggerActivity
Signature | <static> triggerActivity() |
---|---|
Description | Triggers a fake activity to prevent the inactivity timer from closing the agent session. |
popupToast
Signature | <static> popupToast(parameters) → {string} | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | Pops up a new custom toast. | |||||||||||||||||||||||||||||||||
Parameters |
| |||||||||||||||||||||||||||||||||
Returns | A unique identifier |
updateToast
Signature | <static> updateToast(id, parameters) → {boolean} | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | Updates the specified toast. | |||||||||||||||||||||||||||||||||
Parameters |
| |||||||||||||||||||||||||||||||||
Returns | true if the toast has been updated; false if the toast identifier has not been found. |
closeToast
Signature | <static> closeToast(id) → {boolean} | ||||||
---|---|---|---|---|---|---|---|
Description | Closes the specified toast. | ||||||
Parameters |
| ||||||
Returns | true if the toast has been updated; false if the toast identifier has not been found. |
isFrameLeading
Signature | <static> isFrameLeading(succeeded, failed) → {boolean} | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Description | Find out if the browser tab is leading. | |||||||||
Parameters |
| |||||||||
Returns | true if the browser tab is the leader. |
isFrameFollowing
Signature | <static> isFrameFollowing(succeeded, failed) → {boolean} | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Description | Find out if the browser tab is following. | |||||||||
Parameters |
| |||||||||
Returns | true if this browser tab is following. |
isFrameNegotiating
Signature | <static> isFrameNegotiating(succeeded, failed) → {boolean} | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Description | Find out if there is an election in progress and the browser tab state is not yet set to leading or following (the tab is "negotiating.") | |||||||||
Parameters |
| |||||||||
Returns | true if the tab is negotiating. |
isFrameLeadingOrNegotiating
Signature | <static> isFrameLeadingOrNegotiating(succeeded, failed) → {boolean} | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Description | Find out if the browser tab is leading or there is an election in progress and the tab state is not yet set to leading or following (the tab is "negotiating."). | |||||||||
Parameters |
| |||||||||
Returns | true if the browser tab is leading or negotiating. |
isLastActiveFrame
Signature | <static> isLastActiveFrame(succeeded, failed) → {boolean} | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Description | Find out if this is the last active browser tab. | |||||||||
Parameters |
| |||||||||
Returns | true if this is the last active browser tab. |
amIVisible
Signature | <static> amIVisible() → {boolean} |
---|---|
Description | Get the current visibility state of the frame. |
Returns | true if the frame is visible. |
Sample request
setTimeout(function() {
genesys.wwe.service.system.amIVisible(succeeded, failed);
}, 3000); // This gives 3 seconds to switch the panel to test.
Sample response
The asynchronous answer is included in thedata
attribute:{
"request": "system.amIVisible",
"data": true,
"userAgent": "WWE Server",
"protocolVersion": 2
}
openDialog
Signature | <static> openDialog(url, options, succeeded, failed) → {string} | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | Open an iframe in a dialog, based on the configured parameters. | |||||||||||||||
Parameters |
| |||||||||||||||
Returns | The dialog identifier or null if the url parameter is not defined.
|
Sample request
genesys.wwe.service.system.openDialog("<url>", {
label: "Dialog $Agent.FullName$",
width: "430px",
height: "325px"
}, succeeded, failed)
Sample response
The asynchronous answer is included in thedata
attribute:{
"request": "system.openDialog",
"data": "wweCustomDialog1",
"userAgent": "WWE Server",
"protocolVersion": 2
}
closeDialog
Signature | <static> closeDialog(dialogId, succeeded, failed) → {boolean} | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | Close a previously opened dialog. | ||||||||||||
Parameters |
| ||||||||||||
Returns | true if the dialog is closed; false if the dialog is not found. |
Sample request
genesys.wwe.service.system.closeDialog("wweCustomDialog1", succeeded, failed)
Sample response
The asynchronous answer is included in thedata
attribute:{
"request": "system.closeDialog",
"data": true,
"userAgent": "WWE Server",
"protocolVersion": 2
}
Comments or questions about this documentation? Contact us for support!