From Bright Pattern Documentation
No edit summary |
Updated via BpDeleteTranslateTags script |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
= onStatusChange(callback) = | = onStatusChange(callback) = | ||
Gets an agent's state and "Not ready" reason (if any). | Gets an agent's state and "Not ready" reason (if any). | ||
| Line 30: | Line 30: | ||
| '''Example''' | | '''Example''' | ||
|- | |- | ||
| | | status | ||
| string | | string | ||
| agent state | | agent state | ||
| " | | "ready" | ||
|- | |- | ||
| | | reason | ||
| string | | string | ||
| Not ready reason | | Not ready reason | ||
| Line 51: | Line 51: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 04:02, 29 May 2024
onStatusChange(callback)
Gets an agent's state and "Not ready" reason (if any).
Request
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 may contain the following fields.
| Name | Data Type | Description | Example |
| status | string | agent state | "ready" |
| reason | string | Not ready reason | "Break" |
Example
{
"command": "STATE_CHANGED",
"data": {
"status": "ready",
"reason": ""
}
}