From Bright Pattern Documentation
Jump to: navigation, search
• 5.19


setService

Changes the Agent Desktop service by name.

Request

Syntax

setService(service: string): Promise<OperationResult<null>>

Parameters

Parameters Parameter Values Data Type Optional/Required Description
service The values will be determined by your contact center administrator. String Required Allows you to enter the unique ID or the name of the service that you want to select.


Example Request

    setServiceButton.onclick = () => {

        const serviceId = serviceIdInput.value

        adApi.setService(serviceId)

    }

Return Value

null

Sets a custom scenario variable for the associated server’s scenario. If the interactionId value isn't specified, the system will set a variable for the currently active interaction.


Request

Syntax

setVariable(key: string, value: string, interactionId?: string): Promise<OperationResult<null>>

Parameters

Parameters Parameter Values Data Type Optional/Required Description
key String Required Allows you to enter a scenario variable name
value String Required Allows you to enter a scenario variable value
interactionId String Optional The ID of interaction for which you want to set a variable. If no ID is provided, the variable will be set in the currently active interaction.


Example Request

setVariableButton.onclick = () => {

    const variableName = variableNameInput.value

    const variableValue = variableValueInput.value

    const itemId = activeInteractionIdInput.value

    adApi.setVariable(variableName, variableValue, itemId)

}

Return Value

null

< Previous | Next >