From Bright Pattern Documentation
<translate>
Agent State
Agent State is used to request an agent's state and interaction information, as well as to change an agent's state. Use either the getState or setStatus method.
getState
getState can be called any time to request information about an agent's current state and interactions.
Request
window.bpspat.api.getState(callback)
Object-Type
data (JSON)
Response
callback = function(data) { data.agent_id: "john.smith"; data.status: "Not Ready"; data.reason: "Lunch" data.interactions: [ { data.item_id: "123123123"; data.global_id: "asd234asdf234df" data.phone_number: "55511122233" data.service: "Customer Support" data.screenpop_data: "Case: 123123" data.attached_data: {a:b, c:d} data.service: "Customer Support"; }, ... ] }
setStatus
Use the setStatus method to request an agent routing state change (with or without a reason code).
Example
window.bpspat.api.setStatus(status, reason_code="")
</translate>