From Bright Pattern Documentation
Jump to: navigation, search
Tracy (talk | contribs)
Created page with "<translate> = onStatusChange(callback) = Gets an agent's state and "Not ready" reason (if any). == Request == === Syntax === window.bpspat.api.onStatusChange(callback) call..."
 
Tracy (talk | contribs)
No edit summary
Line 42: Line 42:


=== Example ===
=== Example ===
<syntaxhighlight lang="json">
  {
  {
data.status: "Not Ready";
  "command": "STATE_CHANGED",
data.reason: "Lunch";
  "data": {
    "status": "ready",
    "reason": ""
  }
  }
  }
</syntaxhighlight>




</translate>
</translate>

Revision as of 00:01, 27 March 2019

<translate>

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
data.status string agent state "Not Ready"
data.reason string Not ready reason "Break"

Example

 {
  "command": "STATE_CHANGED",
  "data": {
    "status": "ready",
    "reason": ""
  }
 }



</translate>

< Previous | Next >