From Bright Pattern Documentation
• 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)