From Bright Pattern Documentation
Jump to: navigation, search
Line 16: Line 16:
 
|-
 
|-
 
| callback
 
| callback
| function (data)
+
| function
 
| JavaScript method executed when API method request is completed
 
| JavaScript method executed when API method request is completed
 
|}
 
|}
Line 25: Line 25:
 
{|border="1" style="border-collapse:collapse" cellpadding="5"
 
{|border="1" style="border-collapse:collapse" cellpadding="5"
 
| '''Name'''
 
| '''Name'''
 +
| '''Data Type'''
 
| '''Description'''
 
| '''Description'''
 
|-
 
|-
 
| data.agent_id
 
| data.agent_id
| Agent username
+
| string
 +
| agent username
 
|-
 
|-
 
| data.status
 
| data.status
| Agent state (e.g., "Ready" or "Not Ready")
+
| string
 +
| agent state (e.g., "Ready" or "Not Ready")
 
|-
 
|-
 
| data.reason
 
| data.reason
 +
| string
 
| Not Ready reason (e.g., "Lunch" or "Break")
 
| Not Ready reason (e.g., "Lunch" or "Break")
 
|-
 
|-
 
| data.interactions
 
| data.interactions
| Interaction data
+
| array
 +
| List of interaction data
 
|-
 
|-
 
| data.item.id
 
| data.item.id
| Interaction ID (string)
+
| string
 +
| Interaction ID
 
|-
 
|-
 
| data.global_id
 
| data.global_id
| Global interaction ID (GIID; string)
+
| string
 +
| Global interaction ID (GIID)
 
|-
 
|-
 
| data.phone_number
 
| data.phone_number
 +
| string
 
| Customer phone number
 
| Customer phone number
 
|-
 
|-
 
| data.service
 
| data.service
 +
| string
 
| Name of the service handling the interaction
 
| Name of the service handling the interaction
 
|-
 
|-
 
| data.screenpop_data
 
| data.screenpop_data
 +
| string
 
| Information shown on screen-pop
 
| Information shown on screen-pop
 
|-
 
|-
 
| data.attached_data
 
| data.attached_data
 +
| array
 
| File attachments
 
| File attachments
 
|}
 
|}
Line 85: Line 96:
 
{|border="1" style="border-collapse:collapse" cellpadding="5"
 
{|border="1" style="border-collapse:collapse" cellpadding="5"
 
| '''Parameter'''
 
| '''Parameter'''
| '''Type'''
+
| '''Data Type'''
 +
| '''Required/Optional'''
 
| '''Description'''
 
| '''Description'''
 
|-
 
|-
 
| status
 
| status
 
| string
 
| string
 +
| required
 
| Specifies the agent state to be set
 
| Specifies the agent state to be set
 
|-
 
|-
 
| reason_code
 
| reason_code
 
| number
 
| number
 +
| optional
 
| Specifies the reason for agent state change
 
| Specifies the reason for agent state change
 
|}
 
|}

Revision as of 17:38, 8 October 2018

• 5.19 • 5.3 • 5.8

<translate>

Agent State

Agent State is used to request an agent's state and interaction information, as well as to change an agent's state. Use either the getState or setStatus method.

getState

getState can be called any time to request information about an agent's current state and interactions.

Syntax

window.bpspat.api.getState(callback)

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.agent_id string agent username
data.status string agent state (e.g., "Ready" or "Not Ready")
data.reason string Not Ready reason (e.g., "Lunch" or "Break")
data.interactions array List of interaction data
data.item.id string Interaction ID
data.global_id string Global interaction ID (GIID)
data.phone_number string Customer phone number
data.service string Name of the service handling the interaction
data.screenpop_data string Information shown on screen-pop
data.attached_data array File attachments

Example

{
	data.agent_id: "john.smith";
	data.status: "Not Ready";
	data.reason: "Lunch"
	data.interactions: [ {
		data.item_id: "123123123";
		data.global_id: "asd234asdf234df"
		data.phone_number: "55511122233"
		data.service: "Customer Support"
		data.screenpop_data: "Case: 123123"
		data.attached_data: {a:b, c:d}
		data.service: "Customer Support";
 		}, ...
	]
}


setStatus

Requests an agent routing state change (with or without a reason code).

Syntax

window.bpspat.api.setStatus(status, reason_code="")

Parameters

Parameter Data Type Required/Optional Description
status string required Specifies the agent state to be set
reason_code number optional Specifies the reason for agent state change



</translate>

< Previous | Next >