From Bright Pattern Documentation
< 5.19:AgentDesktop-client-side-javascript-api-specification
Revision as of 04:01, 29 May 2024 by BpDeeplTranslateMaintenance (talk | contribs) (Updated via BpDeleteTranslateTags script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
• 5.19



setAgentState

Sets the state of the agent to a specified value.

Note:Value in the notReadyReason is required for the NotReady state. For other states it is not needed..

Request

Syntax

setAgentState(state: AgentState, notReadyReason?: string): Promise<OperationResult<null>>

Where:

"not_ready" |

Parameters

Parameters Parameter Values Data Type Optional/Required Description
state

"ready" "not_ready"

String Required Allows you to set the state of the agent
notReadyReason String Optional Allows you to provide a reason why the agent is not in the Ready state now. Used only for "not_ready" state. Note that entered values must match those defined in the Contact Center Administrator application. You can obtain them programmatically by the API method getAgentNotReadyReasons.

Example Request

   setAgentStateButton.onclick = () => {

       const state = agentStateInput.value

       const notReadyReason = notReadyReasonInput.value

       adApi.setAgentState(state as any, notReadyReason)

   }

Return Value

(None)

< Previous | Next >