API Docs for: 2.0.20133.2
Show:

api.modalities Class

Module: API Modalities
Parent Module: API

Modalities API

Item Index

Methods

Methods

get

(
  • config
)
Promise | Array static

Gets support options configured for a product and issue in a specified lang-loc

Parameters:

  • config Object

    A config object to define the types of modalities required

    • environment String

      A value from api.modalities.Environment (default is api.modalities.Environment.PRODUCTION)

    • product String

      The product for the set of modalities being requested

    • issue String

      The issue for the set of modalities being requested

    • language String

      A two-character string of the language the modalities should be in

    • country String

      A two-character string representing the country the modalities should be in

    • accessibility String

      One of the values from api.modalities.Accessibility (default is api.modalities.Accessibility.NONE)

    • mode String

      A string that points chat at a pool of testers instead of production agents

    • preview Boolean

      A boolean that says whether you want to fetch modalities that are currently in preview mode

Returns:

Promise | Array:

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
)
Promise | Object static

Gets support options configured for a product and issue in a specified lang-loc

Parameters:

  • config Object

    A config object to define the types of modalities required

    • environment String

      A value from api.modalities.Environment (default is api.modalities.Environment.PRODUCTION)

    • product String

      The product for the set of modalities being requested

    • issue String

      The issue for the set of modalities being requested

    • language String

      A two-character string of the language the modalities should be in

    • country String

      A two-character string representing the country the modalities should be in

    • accessibility String

      One of the values from api.modalities.Accessibility (default is api.modalities.Accessibility.NONE)

    • mode String

      A string that points chat at a pool of testers instead of production agents

    • preview Boolean

      A boolean that says whether you want to fetch modalities that are currently in preview mode

    • enhancedRoutingContext Object

      An object that contains key/value pairs for enhanced routing input

Returns:

Promise | Object:

A promise that resolves to an object containing modalities and rendering context

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);
    });