api.modalities Class
Modalities API
Methods
get
-
config
Gets support options configured for a product and issue in a specified lang-loc
Parameters:
-
config
ObjectA config object to define the types of modalities required
-
environment
StringA value from api.modalities.Environment (default is api.modalities.Environment.PRODUCTION)
-
product
StringThe product for the set of modalities being requested
-
issue
StringThe issue for the set of modalities being requested
-
language
StringA two-character string of the language the modalities should be in
-
country
StringA two-character string representing the country the modalities should be in
-
accessibility
StringOne of the values from api.modalities.Accessibility (default is api.modalities.Accessibility.NONE)
-
mode
StringA string that points chat at a pool of testers instead of production agents
-
preview
BooleanA boolean that says whether you want to fetch modalities that are currently in preview mode
-
Returns:
A promise that resolves to an array of modality objects (defined in the API Modalities module)
Example:
var config = {
environment: MsSupportSdk.api.modalities.Environment.DEV // change this to PRODUCTION in PROD
product: "windows",
issue: "setup",
language: "en",
country: "us",
mode: "test" // test mode. DO NOT set this value in PROD
};
// call sdk.api.modalities.get() to get modalities
MsSupportSdk.api.modalities.get(config).then(
function(modalities){
// save the modalities response, which will be used later by Chat
window.savedModalities = modalities;
},
function(err){
console.log(err.message);
});
getv2
-
config
Gets support options configured for a product and issue in a specified lang-loc
Parameters:
-
config
ObjectA config object to define the types of modalities required
-
environment
StringA value from api.modalities.Environment (default is api.modalities.Environment.PRODUCTION)
-
product
StringThe product for the set of modalities being requested
-
issue
StringThe issue for the set of modalities being requested
-
language
StringA two-character string of the language the modalities should be in
-
country
StringA two-character string representing the country the modalities should be in
-
accessibility
StringOne of the values from api.modalities.Accessibility (default is api.modalities.Accessibility.NONE)
-
mode
StringA string that points chat at a pool of testers instead of production agents
-
preview
BooleanA boolean that says whether you want to fetch modalities that are currently in preview mode
-
enhancedRoutingContext
ObjectAn object that contains key/value pairs for enhanced routing input
-
Returns:
Example:
var config = {
environment: MsSupportSdk.api.modalities.Environment.DEV // change this to PRODUCTION in PROD
product: "windows",
issue: "setup",
language: "en",
country: "us",
mode: "test" // test mode. DO NOT set this value in PROD
};
// call sdk.api.modalities.get() to get modalities
MsSupportSdk.api.modalities.get(config).then(
function(modalities){
// save the modalities response, which will be used later by Chat
window.savedModalities = modalities;
},
function(err){
console.log(err.message);
});