Difference between revisions of "PEC-Developer/Current/SCAPI/SystemNamespace"
From Genesys Documentation
(Published) |
|||
Line 33: | Line 33: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> getAllowedServices() → {Array.<string>} | + | {{!}}<static> getAllowedServices(succeeded, failed) → {Array.<string>} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
{{!}}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. | {{!}}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. | ||
+ | {{!}}- | ||
+ | !Parameters | ||
+ | {{!}} | ||
+ | {{{!}} | ||
+ | !Name | ||
+ | !Type | ||
+ | !Description | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation succeeds. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation fails. | ||
+ | {{!}}} | ||
{{!}}- | {{!}}- | ||
!Returns | !Returns | ||
Line 45: | Line 61: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> triggerActivity() | + | {{!}}<static> triggerActivity(succeeded, failed) |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
{{!}}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. | {{!}}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. | ||
+ | {{!}}- | ||
+ | !Parameters | ||
+ | {{!}} | ||
+ | {{{!}} | ||
+ | !Name | ||
+ | !Type | ||
+ | !Description | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation succeeds. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation fails. | ||
+ | {{!}}} | ||
{{!}}} | {{!}}} | ||
Line 55: | Line 87: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> popupToast(''parameters'') → {string} | + | {{!}}<static> popupToast(''parameters'', succeeded, failed) → {string} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 63: | Line 95: | ||
{{!}} | {{!}} | ||
{{{!}} | {{{!}} | ||
+ | !Name | ||
+ | !Type | ||
+ | !Description | ||
+ | {{!}}- | ||
+ | {{!}}parameters | ||
+ | {{!}}object | ||
+ | {{!}} | ||
+ | {{{!}} border="1" | ||
+ | {{!}}- | ||
!Name | !Name | ||
!Type | !Type | ||
Line 106: | Line 147: | ||
{{!}}number | {{!}}number | ||
{{!}}Optional. The width of the custom toast popup, in pixels. This values takes precedence over the service-client-api.toast.width configuration option. | {{!}}Optional. The width of the custom toast popup, in pixels. This values takes precedence over the service-client-api.toast.width configuration option. | ||
+ | {{!}}} | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation succeeds. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation fails. | ||
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 116: | Line 166: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> updateToast(''id'', ''parameters'') → {boolean} | + | {{!}}<static> updateToast(''id'', ''parameters'', succeeded, failed) → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 169: | Line 219: | ||
{{!}}If set to <tt>true</tt>, displays '''Show''' and '''Dismiss''' buttons and pops up the current iframe if the '''Show''' button is pushed. If set to <tt>false</tt>, displays '"OK"' or custom buttons based on the parameter's buttons. | {{!}}If set to <tt>true</tt>, displays '''Show''' and '''Dismiss''' buttons and pops up the current iframe if the '''Show''' button is pushed. If set to <tt>false</tt>, displays '"OK"' or custom buttons based on the parameter's buttons. | ||
{{!}}} | {{!}}} | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation succeeds. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation fails. | ||
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 179: | Line 237: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> closeToast(''id'') → {boolean} | + | {{!}}<static> closeToast(''id'', succeeded, failed) → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 194: | Line 252: | ||
{{!}}string | {{!}}string | ||
{{!}}The identifier of the toast to close. The identifier is returned by the {{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=popupToast|display text=popupToast}} method. | {{!}}The identifier of the toast to close. The identifier is returned by the {{Link-SomewhereInThisManual|topic=SystemNamespace|anchor=popupToast|display text=popupToast}} method. | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation succeeds. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation fails. | ||
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 217: | Line 283: | ||
{{!}}- | {{!}}- | ||
{{!}}succeeded | {{!}}succeeded | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation succeeds. |
{{!}}- | {{!}}- | ||
{{!}}failed | {{!}}failed | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation fails. |
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 246: | Line 312: | ||
{{!}}- | {{!}}- | ||
{{!}}succeeded | {{!}}succeeded | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation succeeds. |
{{!}}- | {{!}}- | ||
{{!}}failed | {{!}}failed | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation fails. |
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 275: | Line 341: | ||
{{!}}- | {{!}}- | ||
{{!}}succeeded | {{!}}succeeded | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation succeeds. |
{{!}}- | {{!}}- | ||
{{!}}failed | {{!}}failed | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation fails. |
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 304: | Line 370: | ||
{{!}}- | {{!}}- | ||
{{!}}succeeded | {{!}}succeeded | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation succeeds. |
{{!}}- | {{!}}- | ||
{{!}}failed | {{!}}failed | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation fails. |
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 333: | Line 399: | ||
{{!}}- | {{!}}- | ||
{{!}}succeeded | {{!}}succeeded | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation succeeds. |
{{!}}- | {{!}}- | ||
{{!}}failed | {{!}}failed | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation fails. |
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 348: | Line 414: | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> amIVisible() → {boolean} | + | {{!}}<static> amIVisible(succeeded, failed) → {boolean} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
{{!}}Get the current visibility state of the frame. | {{!}}Get the current visibility state of the frame. | ||
+ | {{!}}- | ||
+ | !Parameters | ||
+ | {{!}} | ||
+ | {{{!}} | ||
+ | !Name | ||
+ | !Type | ||
+ | !Description | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation succeeds. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation fails. | ||
+ | {{!}}} | ||
{{!}}- | {{!}}- | ||
!Returns | !Returns | ||
Line 401: | Line 483: | ||
{{!}}- | {{!}}- | ||
{{!}}succeeded | {{!}}succeeded | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation succeeds. |
{{!}}- | {{!}}- | ||
{{!}}failed | {{!}}failed | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation fails. |
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 452: | Line 534: | ||
{{!}}- | {{!}}- | ||
{{!}}succeeded | {{!}}succeeded | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation succeeds. |
{{!}}- | {{!}}- | ||
{{!}}failed | {{!}}failed | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation fails. |
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- |
Revision as of 13:44, February 22, 2023
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(succeeded, failed) → {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. | |||||||||
Parameters |
| |||||||||
Returns | Array.<string> |
triggerActivity
Signature | <static> triggerActivity(succeeded, failed) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Description | Triggers a fake activity to prevent the inactivity timer from closing the agent session. | |||||||||
Parameters |
|
popupToast
Signature | <static> popupToast(parameters, succeeded, failed) → {string} | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | Pops up a new custom toast. | |||||||||||||||||||||||||||||||||||||||||||||
Parameters |
| |||||||||||||||||||||||||||||||||||||||||||||
Returns | A unique identifier |
updateToast
Signature | <static> updateToast(id, parameters, succeeded, failed) → {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, succeeded, failed) → {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(succeeded, failed) → {boolean} | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Description | Get the current visibility state of the frame. | |||||||||
Parameters |
| |||||||||
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!