From Bright Pattern Documentation
< 5.19:Embedded-agent-desktop-sdk-specification | Events
Revision as of 23:54, 12 February 2019 by Tracy (talk | contribs) (Tracy moved page 5.3:Embedded-agent-desktop-sdk-specification/Events/AgentStatus to 5.3:Embedded-agent-desktop-sdk-specification/Events/onStatusChangeCallback)
<translate>
onStatusChange(callback)
Gets an agent's state and "Not ready" reason (if any).
Syntax
window.bpspat.api.onStatusChange(callback)
callback = function(data) {
}
Arguments
| 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 | Example |
| data.status | string | agent state | "Not Ready" |
| data.reason | string | Not ready reason | "Break" |
Example
{
data.status: "Not Ready";
data.reason: "Lunch";
}
</translate>