From Bright Pattern Documentation
<translate>
Agent Status
The Agent Status method is used to request an agent's state and interaction information, as well as to change an agent's state.
getState
getState can be called any time to request information about an agent's current state and interactions.
Example
window.bpspat.api.getState(callback)
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>