From Bright Pattern Documentation
<translate>
Agent Status
The Agent Status method gets an agent's state and reason (if any).
Syntax
window.bpspat.api.onStatusChange(callback)
callback = function(data) {
}
Parameters
| Parameter | Type | Description |
| callback | function | JavaScript method executed when API method request is completed |
Response
The response object contains the following fields.
| Name | Data Type | Description |
| data.status | string | agent state (e.g., "Ready", "Not Ready", etc.) |
| data.reason | string | Not Ready reason (e.g., "Break", "Meeting", etc.) |
Example
{
data.status: "Not Ready";
data.reason: "Lunch";
}
</translate>