Difference between revisions of "PEC-Developer/Current/SCAPI/ConfigurationNamespace"
m (Text replacement - "\|Platform=([^\|]*)GenesysEngage-onpremises([\|]*)" to "|Platform=$1GenesysEngage-cloud$2") |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
|ComingSoon=No | |ComingSoon=No | ||
|Platform=GenesysEngage-cloud | |Platform=GenesysEngage-cloud | ||
− | |||
|Section={{Section | |Section={{Section | ||
− | |||
− | |||
|alignment=Vertical | |alignment=Vertical | ||
− | + | |structuredtext={{NoteFormat|Depending on your environment, you might need to contact your Genesys representative to complete the configuration described on this page.|}}<br /> | |
− | |||
− | |structuredtext={{NoteFormat| | ||
− | |||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
Line 21: | Line 14: | ||
|anchor=Methods | |anchor=Methods | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
− | |||
|structuredtext=The Configuration namespace includes the following methods: | |structuredtext=The Configuration namespace includes the following methods: | ||
*{{Link-SomewhereInThisManual|topic=ConfigurationNamespace|anchor=getOption|display text=getOption}} | *{{Link-SomewhereInThisManual|topic=ConfigurationNamespace|anchor=getOption|display text=getOption}} | ||
+ | *{{Link-SomewhereInThisManual|topic=ConfigurationNamespace|anchor=getContextualOption|display text=getContextualOption}} | ||
===getOption=== | ===getOption=== | ||
{{{!}} | {{{!}} | ||
!Signature | !Signature | ||
− | {{!}}<static> getOption(''options'') → {Array.<{{Link-SomewhereInThisManual|topic=ConfigurationNamespace|anchor=Section|display text=Section}}>} | + | {{!}}<static> getOption(''options'', succeeded, failed) → {Array.<{{Link-SomewhereInThisManual|topic=ConfigurationNamespace|anchor=Section|display text=Section}}>} |
{{!}}- | {{!}}- | ||
!Description | !Description | ||
Line 40: | Line 32: | ||
!Name | !Name | ||
!Type | !Type | ||
− | |||
!Description | !Description | ||
{{!}}- | {{!}}- | ||
{{!}}options | {{!}}options | ||
{{!}}string | {{!}}string | ||
− | + | {{!}}An array of configuration options or sections to return. Unless otherwise specified, the API returns options from the '''[interaction-workspace]''' section by default. You can specify any of the following: | |
− | {{!}}An array of configuration options or sections to return. Unless otherwise specified, the API | ||
*A single option: <tt>genesys.wwe.service.configuration.getOption('voice.auto-answer', succeeded, failed)</tt> | *A single option: <tt>genesys.wwe.service.configuration.getOption('voice.auto-answer', succeeded, failed)</tt> | ||
Line 64: | Line 54: | ||
*<nowiki>*.mark-done</nowiki> | *<nowiki>*.mark-done</nowiki> | ||
*<nowiki>*.auto</nowiki> | *<nowiki>*.auto</nowiki> | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation succeeds. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation fails. | ||
+ | {{!}}} | ||
+ | {{!}}- | ||
+ | !Returns | ||
+ | {{!}}Array.<{{Link-SomewhereInThisManual|topic=ConfigurationNamespace|anchor=Section|display text=Section}}> | ||
+ | {{!}}} | ||
+ | |||
+ | ===getContextualOption=== | ||
+ | {{{!}} | ||
+ | !Signature | ||
+ | {{!}}<static> getContextualOption(''options'', ''interactionId'', succeeded, failed) → {Array.<{{Link-SomewhereInThisManual|topic=ConfigurationNamespace|anchor=Section|display text=Section}}>} | ||
+ | {{!}}- | ||
+ | !Description | ||
+ | {{!}}Get configuration options and values in the context of this interaction when they are overridden by a routing strategy. If the interaction is not found or this parameter is missing, the API throws an exception. Note: The getContextualOption method can be applied to any option, even if the option doesn’t support overriding options with a routing strategy in Workspace Web Edition. Only Workspace Web Edition options with the following text in their descriptions can be overridden by a routing strategy: "This option can be overridden by a routing strategy as described in this [https://docs.genesys.com/Documentation/HTCC/8.5.2/IWWDep/OverridingInteractionWorkspaceOptions Configuration Guide]." Using the getContextualOption method doesn’t interfere with how Workspace Web Edition handles options. | ||
+ | {{!}}- | ||
+ | !Parameters | ||
+ | {{!}} | ||
+ | {{{!}} | ||
+ | !Name | ||
+ | !Type | ||
+ | !Description | ||
+ | {{!}}- | ||
+ | {{!}}options | ||
+ | {{!}}string | ||
+ | {{!}}An option or array of options and their values. Unless otherwise specified, the API returns options from the '''[interaction-workspace]''' section by default. You can specify any of the following: | ||
+ | |||
+ | *A single option by name: <tt>genesys.wwe.service.configuration.getOption('voice.auto-answer', succeeded, failed)</tt> | ||
+ | *A subset of options defined by '*': | ||
+ | *A subset of options in a specific section: <tt>genesys.wwe.service.configuration.getOption('interaction-workspace/interaction.case-data.*', succeeded, failed)</tt> | ||
+ | |||
+ | You can use an asterisk '*' as a wildcard, but only at the end of each word. For example: | ||
+ | |||
+ | *voice.* | ||
+ | *voice.auto* | ||
+ | *sipendpoint.* | ||
+ | *CustomAPI/test.* | ||
+ | |||
+ | You cannot use an asterisk at the start of an option or section. For example, the following values are not allowed: | ||
+ | |||
+ | *<nowiki>*.mark-done</nowiki> | ||
+ | *<nowiki>*.auto</nowiki> | ||
+ | {{!}}- | ||
+ | {{!}}interactionId | ||
+ | {{!}}string | ||
+ | {{!}}The unique identifier for the interaction. | ||
+ | {{!}}- | ||
+ | {{!}}succeeded | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation succeeds. | ||
+ | {{!}}- | ||
+ | {{!}}failed | ||
+ | {{!}}function | ||
+ | {{!}}A function called when the operation fails. | ||
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 69: | Line 119: | ||
{{!}}Array.<{{Link-SomewhereInThisManual|topic=ConfigurationNamespace|anchor=Section|display text=Section}}> | {{!}}Array.<{{Link-SomewhereInThisManual|topic=ConfigurationNamespace|anchor=Section|display text=Section}}> | ||
{{!}}} | {{!}}} | ||
− | |||
− | |||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
Line 76: | Line 124: | ||
|anchor=Typedefinitions | |anchor=Typedefinitions | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |||
− | |||
|structuredtext=The Configuration namespace includes the following object types: | |structuredtext=The Configuration namespace includes the following object types: | ||
Line 106: | Line 152: | ||
{{!}}} | {{!}}} | ||
{{!}}} | {{!}}} | ||
− | | | + | |Status=No |
− | | | + | }}{{Section |
+ | |sectionHeading=Examples | ||
+ | |anchor=examples | ||
+ | |alignment=Vertical | ||
+ | |structuredtext=Consider the following scenario: | ||
+ | |||
+ | #You set <code>interaction-workspace/interaction.case-data.frame-color"="#FFBA00"</code>. | ||
+ | #You also set the override option key: <code>"interaction-workspace/interaction.override-option-key"="IW_OverrideOptions"</code>. | ||
+ | #An interaction arrives with the attached data <code>"IW_OverrideOptions"="CaseDataColor"</code>. | ||
+ | #The transaction object "CaseDataColor" annex has the option <code>"interaction-workspace/interaction.case-data.frame-color"="#FF000088"</code>. | ||
+ | |||
+ | Here's how this scenario would look for each of the Configuration namespace methods: | ||
+ | |||
+ | ===getContextualOption()=== | ||
+ | |||
+ | Use getContextualOption() to get the option:<syntaxhighlight lang="javascript"> | ||
+ | genesys.wwe.service.configuration.getContextualOption("interaction.case-data.frame-color", "1", succeeded, failed) | ||
+ | </syntaxhighlight>You receive this response:<syntaxhighlight lang="json"> | ||
+ | { | ||
+ | "request": "configuration.getContextualOption", | ||
+ | "data": { | ||
+ | "interaction-workspace": { | ||
+ | "interaction.case-data.frame-color": "#FF008000" | ||
+ | } | ||
+ | }, | ||
+ | "userAgent": "WWE Server", | ||
+ | "protocolVersion": 2 | ||
+ | } | ||
+ | </syntaxhighlight>If the interaction isn't found, the failed callback receives this response:<syntaxhighlight lang="json"> | ||
+ | { | ||
+ | "request": "configuration.getContextualOption", | ||
+ | "errorMessage": "Error: Interaction not found.", | ||
+ | "userAgent": "WWE Server", | ||
+ | "protocolVersion": 2 | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===getOption()=== | ||
+ | Use getOption() to get the option::<syntaxhighlight lang="javascript"> | ||
+ | genesys.wwe.service.configuration.getOption("interaction.case-data.frame-color", succeeded, failed) | ||
+ | </syntaxhighlight>The response includes the original default value of the option instead of the overridden value:<syntaxhighlight lang="json"> | ||
+ | { | ||
+ | "request": "configuration.getOption", | ||
+ | "data": { | ||
+ | "interaction-workspace": { | ||
+ | "interaction.case-data.frame-color": "#FFBA00" | ||
+ | } | ||
+ | }, | ||
+ | "userAgent": "WWE Server", | ||
+ | "protocolVersion": 2 | ||
+ | } | ||
+ | </syntaxhighlight> | ||
|Status=No | |Status=No | ||
}} | }} | ||
}} | }} |
Latest revision as of 13:44, February 22, 2023
Contents
Learn about the Configuration namespace methods and type definitions in the Service Client API.
Methods
The Configuration namespace includes the following methods:
getOption
Signature | <static> getOption(options, succeeded, failed) → {Array.<Section>} | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | Get configuration options and values for a specific option name or a subset of options from the [interaction-workspace] section or a custom section. | ||||||||||||
Parameters |
| ||||||||||||
Returns | Array.<Section> |
getContextualOption
Signature | <static> getContextualOption(options, interactionId, succeeded, failed) → {Array.<Section>} | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | Get configuration options and values in the context of this interaction when they are overridden by a routing strategy. If the interaction is not found or this parameter is missing, the API throws an exception. Note: The getContextualOption method can be applied to any option, even if the option doesn’t support overriding options with a routing strategy in Workspace Web Edition. Only Workspace Web Edition options with the following text in their descriptions can be overridden by a routing strategy: "This option can be overridden by a routing strategy as described in this Configuration Guide." Using the getContextualOption method doesn’t interfere with how Workspace Web Edition handles options. | |||||||||||||||
Parameters |
| |||||||||||||||
Returns | Array.<Section> |
Type definitions
The Configuration namespace includes the following object types:
Section
Description | Represents the JSON structure of a configuration section. Each section includes a list of key/value pairs for the matching option(s). | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Type | Object | |||||||||
Properties |
|
Examples
Consider the following scenario:
- You set
interaction-workspace/interaction.case-data.frame-color"="#FFBA00"
. - You also set the override option key:
"interaction-workspace/interaction.override-option-key"="IW_OverrideOptions"
. - An interaction arrives with the attached data
"IW_OverrideOptions"="CaseDataColor"
. - The transaction object "CaseDataColor" annex has the option
"interaction-workspace/interaction.case-data.frame-color"="#FF000088"
.
Here's how this scenario would look for each of the Configuration namespace methods:
getContextualOption()
Use getContextualOption() to get the option:genesys.wwe.service.configuration.getContextualOption("interaction.case-data.frame-color", "1", succeeded, failed)
{
"request": "configuration.getContextualOption",
"data": {
"interaction-workspace": {
"interaction.case-data.frame-color": "#FF008000"
}
},
"userAgent": "WWE Server",
"protocolVersion": 2
}
{
"request": "configuration.getContextualOption",
"errorMessage": "Error: Interaction not found.",
"userAgent": "WWE Server",
"protocolVersion": 2
}
getOption()
Use getOption() to get the option::genesys.wwe.service.configuration.getOption("interaction.case-data.frame-color", succeeded, failed)
{
"request": "configuration.getOption",
"data": {
"interaction-workspace": {
"interaction.case-data.frame-color": "#FFBA00"
}
},
"userAgent": "WWE Server",
"protocolVersion": 2
}