From Bright Pattern Documentation
Jump to: navigation, search
(Created page with "<translate> = onAgentLogin(callback) = Shows whether an agent is logged in or out of Agent Desktop. == Request == === Syntax === window.bpspat.api.onAgentLogin(callback) ca...")
 
 
Line 30: Line 30:
 
| '''Example'''
 
| '''Example'''
 
|-
 
|-
| data.agent_id
+
| agent_id
 
| string
 
| string
 
| agent username
 
| agent username
 
| "john.smith"
 
| "john.smith"
 
|-
 
|-
| data.login
+
| login
 
| boolean
 
| boolean
 
| Whether agent is logged in (true) or not (false)
 
| Whether agent is logged in (true) or not (false)
Line 42: Line 42:
  
 
=== Example ===
 
=== Example ===
 +
<syntaxhighlight lang="json">
 
  {
 
  {
data.agent_id: "john.smith";
+
  "command": "LOGIN_CHANGED",
data.login: true;
+
  "data": {
  }  
+
    "agent_id": "christy.borden",
 +
    "login": false
 +
  }
 +
  }
 +
</syntaxhighlight>
 +
 
 +
 
  
  
  
 
</translate>
 
</translate>

Latest revision as of 23:58, 26 March 2019

• 5.19 • 5.3 • 5.8

onAgentLogin(callback)

Shows whether an agent is logged in or out of Agent Desktop.

Request

Syntax

window.bpspat.api.onAgentLogin(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
agent_id string agent username "john.smith"
login boolean Whether agent is logged in (true) or not (false) false

Example

 {
  "command": "LOGIN_CHANGED",
  "data": {
    "agent_id": "christy.borden",
    "login": false
  }
 }



< Previous | Next >