Learn about the Configuration namespace methods and type definitions 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 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
|
Name
|
Type
|
Description
|
options
|
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:
- A single option: genesys.wwe.service.configuration.getOption('voice.auto-answer', succeeded, failed)
- A single option in a specific section: genesys.wwe.service.configuration.getOption('CustomSection/option.custom.customer.code', succeeded, failed)
- Multiple options: genesys.wwe.service.configuration.getOption(['voice.auto-answer', 'privilege.email.can-mark-done'], succeeded, failed)
- Multiple options in different sections: genesys.wwe.service.configuration.getOption(['privilege.*', 'CustomSection/option.custom.customer.code'], succeeded, failed)
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:
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
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
|
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: genesys.wwe.service.configuration.getOption('voice.auto-answer', succeeded, failed)
- A subset of options defined by '*':
- A subset of options in a specific section: genesys.wwe.service.configuration.getOption('interaction-workspace/interaction.case-data.*', succeeded, failed)
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:
|
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.
|
|
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
|
Name
|
Type
|
Description
|
name
|
string
|
The name of the configuration option.
|
value
|
string or array of strings
|
The value of the configuration option.
|
|
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)
You receive this response:
{
"request": "configuration.getContextualOption",
"data": {
"interaction-workspace": {
"interaction.case-data.frame-color": "#FF008000"
}
},
"userAgent": "WWE Server",
"protocolVersion": 2
}
If the interaction isn't found, the failed callback receives this response:
{
"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)
The response includes the original default value of the option instead of the overridden value:
{
"request": "configuration.getOption",
"data": {
"interaction-workspace": {
"interaction.case-data.frame-color": "#FFBA00"
}
},
"userAgent": "WWE Server",
"protocolVersion": 2
}