Difference between revisions of "PEC-Developer/Current/SCAPI/ConfigurationNamespace"

From Genesys Documentation
Jump to: navigation, search
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
|Prereq=
 
 
|Section={{Section
 
|Section={{Section
|sectionHeading=
 
|anchor=
 
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
+
|structuredtext={{NoteFormat|Depending on your environment, you might need to contact your Genesys representative to complete the configuration described on this page.|}}<br />
|image=
 
|structuredtext={{NoteFormat|You must work with your Genesys representative to enable and use this part of the Service Client API.}}
 
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 21: Line 14:
 
|anchor=Methods
 
|anchor=Methods
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|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
!Argument
 
 
!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 will return options from the '''[interaction-workspace]''' section by default. You can specify any of the following:
 
  
 
*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}}>
 
{{!}}}
 
{{!}}}
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 76: Line 124:
 
|anchor=Typedefinitions
 
|anchor=Typedefinitions
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=The Configuration namespace includes the following object types:
 
|structuredtext=The Configuration namespace includes the following object types:
  
Line 106: Line 152:
 
{{!}}}
 
{{!}}}
 
{{!}}}
 
{{!}}}
|structuredtextwide=
+
|Status=No
|FAQHeading=
+
}}{{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

This topic is part of the manual Service Client API Reference for version Current of Developer.

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:

  • *.mark-done
  • *.auto
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:

  • *.mark-done
  • *.auto
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:

  1. You set interaction-workspace/interaction.case-data.frame-color"="#FFBA00".
  2. You also set the override option key: "interaction-workspace/interaction.override-option-key"="IW_OverrideOptions".
  3. An interaction arrives with the attached data "IW_OverrideOptions"="CaseDataColor".
  4. 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
}
Comments or questions about this documentation? Contact us for support!